Hello, I am new to JavaScript. I have created a table with checkbox rows and now I want to test it. However, I am encountering an error in my index.js file.
Here is my code:
import React from 'react';
import { Spin, Table } from 'antd';
import { useFetch } from 'innroad.common.ui';
import * as apiService from 'services/ApiService';
const AccountType = (onSelectingItems) => {
const [data, isLoading] = useFetch(apiService.accountType);
return (
<Spin spinning={isLoading}>
<Table
key="id"
bordered="true"
rowKey="id"
dataSource={data}
rowSelection={{ onChange: onSelectingItems }}
pagination={false}
>
<Table.Column title="Account Type" dataIndex="accountType" />
</Table>
</Spin>
);
};
/* AccountType.propTypes = {
selectionType: PropTypes.string,
onSelectingLineItems: PropTypes.func,
}; */
AccountType.defaultProps = {
selectionType: 'checkbox',
onSelectingLineItems: () => { },
};
export default AccountType;
I also have one more question: Should I use AccountType.propTypes, the commented block? If yes, how should I modify it? Currently, I am getting an error in this block stating that it's declared but not used.
Index.JS (Error occurs here)
export { default } from './AccountType';
The expected linebreaks are 'LF' but found 'CRLF'.eslintlinebreak-style after ";"