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

Incorrect Example on Storyboard #842

Closed aryang4rg closed 3 years ago

aryang4rg commented 3 years ago

The documentation in https://jbetancur.github.io/react-data-table-component/?path=/story/expandable-rows--basic seems to be incorrect.

The error in the code is here:

 return (
    <DataTable
      title="Movie List - No additional info for old movies (Before 2000)"
      columns={columns}
      data={data}
      expandableRows
      expandableRowDisabled={row => row.disabled}
      highlightOnHover
      defaultSortField="name"
      expandableRowsComponent={<ExpandedComponent />}
    />

Where it says expandableRowsComponent={}

According to the README file

A custom component to display in the expanded row. Must be passed as: MyExpander not . Your component will have access to the row data. For example: const MyExpander = props =>

{props.data.name}

And in the stories/DataTable/Basic/Expandable.stories.js , it shows the correct code

    <DataTable
        title="Movie List"
        columns={columns}
        data={tableDataItems}
        expandableRows
        expandableRowsComponent={ExpandedComponent}
    />

but this is not the case on the website.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.