table-library / react-table-library

:bento: React Table Library
https://react-table-library.com
MIT License
747 stars 47 forks source link

one-line fix to getting started documentation #143

Open hoglund666 opened 11 months ago

hoglund666 commented 11 months ago

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 }.