react-table-library icon indicating copy to clipboard operation
react-table-library copied to clipboard

one-line fix to getting started documentation

Open hoglund666 opened this issue 2 years ago • 0 comments

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

hoglund666 avatar Dec 31 '23 07:12 hoglund666