-
Notifications
You must be signed in to change notification settings - Fork 927
Description
All three versions try to showcase a general problem in the functionality of expandable rows. I was trying to make the program call for a get request from server and update the state of the data in the current expandable row. But although fetching the data correctly and storing it, and being displayed on screen for a second the setState itself was the cause that collapsed the expanded row.
As shown bellow three different ways that a setState is being called cause the same problem to occur.
[1]
onTableChange: (action, tableState) => { switch (action) { case 'expandRow': this.setState({age: 1}) break; default: break; } }
[2]
onRowsExpand: (curExpanded, allExpanded) => { this.setState({age: 1}) }
[3]
onRowClick: (rowData, rowState) => { this.setState({age: 1}) }