Can anyone spot an obvious error with this code:
import React from 'react';
import DataTable from 'react-data-components';
export default class ListTable extends React.Component {
constructor(props) {
super(props);
}
render(){
var columns = [
{ title: 'Name', prop: 'name' },
{ title: 'City', prop: 'city' },
{ title: 'Address', prop: 'address' },
{ title: 'Phone', prop: 'phone' }
];
var data = [
{ name: 'name value', city: 'city value', address: 'address value', phone: 'phone value' }
];
return(<DataTable className="table-format-1" keys={[ 'name', 'address' ]} columns={columns} initialData={data} initialPageLength={5} pageLengthOptions={[ 5, 20, 50 ]} />);
}
};
I am getting the following error:
Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). Check the render method of
ListTable
.