Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const React = require('react');
const Table = require('react-table').default;
class TableComponent extends React.PureComponent {
getColumns() {
if (this.props.columns) {
if (
this.props.columns.length &&
typeof this.props.columns[0] === 'string'
) {
return this.props.columns.map(d => {
return {
Header: d,
accessor: d
};
});
}
function make(props, className, type_, defaultPageSize, page, pageSize, columns, data, onPageChange, onPageSizeChange, getTdProps, children) {
return ReasonReact.wrapJsForReason(ReactTable.default, Curry.app(props, [
className,
type_,
columns,
defaultPageSize,
page,
pageSize,
data,
onPageChange,
onPageSizeChange,
getTdProps
]), children);
}