The react-table ponent is really cool and getting the data in is a breeze.
But when I try to get a detail ponent to load when a row is expanded it seems to confuse the row code. I've tried to use the ponentWillMount 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?
The react-table https://react-table.js ponent is really cool and getting the data in is a breeze.
But when I try to get a detail ponent to load when a row is expanded it seems to confuse the row code. I've tried to use the ponentWillMount 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?
Share Improve this question asked Aug 15, 2017 at 19:12 MichaudMichaud 1,1068 silver badges12 bronze badges 2- What do you want to achieve? Have you looked into this example: react-table.js/#/story/sub-ponents ? – An Nguyen Commented Aug 15, 2017 at 19:15
- yes, I did look at the example, but that uses the one data set for the table and the subponent. I made the subponent an actual react ponent. What I want to achieve is: show data in table > expand row > load more data , show it in the expanded row. – Michaud Commented Aug 15, 2017 at 22:11
1 Answer
Reset to default 7I'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}