Michaud
Michaud

Reputation: 1106

react-table load detail data when row is expanded

The react-table https://react-table.js.org component is really cool and getting the data in is a breeze.

But when I try to get a detail component to load when a row is expanded it seems to confuse the row code. I've tried to use the componentWillMount or update functions of the React Component class but when I expand the row it collapses again.

I'm using axios to fetch the data from a server , feed it into the redux state and add it to the row data but the row data in the table doesn't seem to update when the data in the redux state updates.

Does react-table support this use-case?

Upvotes: 4

Views: 6188

Answers (1)

Jesper
Jesper

Reputation: 458

I've had the same problem. So far, I managed to stop the expanded row from collapsing by adding this property to the main table

freezeWhenExpanded={true}

Upvotes: 7

Related Questions