jbetancur / react-data-table-component

A responsive table library with built-in sorting, pagination, selection, expandable rows, and customizable styling.
https://react-data-table-component.netlify.app
Apache License 2.0
2.04k stars 412 forks source link

[Documentation Error] #877

Closed wilsonwg closed 3 years ago

wilsonwg commented 3 years ago

In Section 11, Expandable Rows

const ExpandableComponent = ({ data }) => ;

class MyComponent extends Component { render() { return ( <DataTable title="Arnold Movies" columns={columns} data={data} selectableRows selectableRowsComponent={Checkbox} selectableRowsComponentProps={{ inkDisabled: true }} sortIcon={arrow_downward} onSelectedRowsChange={handleChange} expandableRows expandableRowsComponent={ExpandableComponent} /> ) } };

I think it's better to be written as: expandableRowsComponent={}

Otherwise it may lead to confusion and result errors.

jbetancur commented 3 years ago

Please see https://github.com/jbetancur/react-data-table-component/issues/888 for the correct syntax for version 6 and 7. Also notable documentation changes are being made prior to the imminent release of version 7