react-table-library
react-table-library copied to clipboard
one-line fix to getting started documentation
This one line fix to the getting started section of the docs would have saved me an hour:
The working code follows, where forecasts is an array of data items to display.
const data = {
nodes: forecasts
};
and then this works,
return (
<CompactTable columns={colDefs} data={data} theme={theme}></CompactTable>
);
BUT, the example initializes the data object like this:
const data = { nodes };
Where nodes is an array of data items to display. The complete syntax would have been something like nodes: nodes but I guess javascript just took the shorthand. For quite some time I didn't realize I needed to put { nodes: my_array_name }.