RowSelectionState change is not persisted after row selection
When I select a row, the selection state seems to be refreshed, anyone have encoutered a similar issue ?


4 Replies
genetic-orange•14mo ago
The
useEffect
is undoubtedly the issue here. There are plenty of examples in the docs that showcase row selection. There is no need for useEffect
at all for this and in general with Tanstack and React as most of the state is either managed by Tanstack Table or via your own useState
hooks.
Check out the documentation and remove the useEffect
.like-gold•14mo ago
The main weird thing that I see here is that you are not passing the state back to the table.

like-gold•14mo ago
So just pass in the rowSelection state and it should work like normal
grumpy-cyanOP•13mo ago
Yup, I should probably review my code with your explanations. Thanks for the tips 👍