I am able to show all the subrows on my table using the defaultExpanded
property like this -
const defaultExpandedRows = data.map((element, index) => {
return { index: true };
});
...
<ReactTable
...
defaultExpanded={defaultExpandedRows}
...
/>
My problem is that this only works on the initial page load, and when I click on the next page, none of the subrows are expanded.
Is there a way to keep all the subrows open, even after the re-renders from page change?
Figured it out, just needed to add an
expanded={defaultExpandedRows}