You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug with the table, this issue is with how you are setting state. Mutating the data and not assigning it a new reference before setting the state will result in React's reference check resulting in true and component not re-rendering.
Changing Line 5 to setData([...rslts]) will update the state of your component and re-render the table as well since data has changed
Assuming random is a boolean, since booleans are primitives and cannot be mutated is the reason your second setRandom on line 8 works.
But for arrays and objects in state always make sure to change the reference to the state before setting it. Your code will also work if you change line 2 as const rslts = [...data];
I want to update checkBox status in 'onRowClick' event .
When i write code above it works but the application locked when i click repeatedly.
Note: Recommended solution for class component is code above except eighth line but i use function component.
Also if i remove eighth line, the following bug is happening;
Thanks for helping...
The text was updated successfully, but these errors were encountered: