I have component which I am rendering in parent component. But its not working and giving me an error
react.createelement type is invalid expected a string but got undefined
I have a data in state object which is a array of objects.
import React, { Component } from "react";
import ReactTable from "react-table";
//import "react-table/react-table.css";
class CustomerTable extends Component {
constructor(props) {
super(props);
this.state = {
tableData: this.props.Data,
};
}
render() {
console.log("this.state.tableData", this.state.tableData);
const columns = [
{
Header: "Customer ID",
accessor: "CUSTOMER_ID",
},
{
Header: "Customer Name",
accessor: "NAME",
},
{
Header: "Customer Type",
accessor: "TYPE",
},
];
return (
<div>
<ReactTable columns={columns} data={this.state.tableData}>
</ReactTable>
</div>
);
}
}
export default CustomerTable;
Another issue is that if I uncomment css import line I am getting an error
Module not found: Can't resolve 'react-table/react-table.css'
I checked in package.json and its verion is "react-table": "^7.0.4". But I cant see react-table.css file in node_module. What am I missing here.