T
TanStack2y ago
foreign-sapphire

Best way to reset rowSelection on data change

👋🏽 Hey, I wonder what is the best way to reset the selected rows when the data changes (server side-sorting, or server-side pagination). Initially the rowSelection should not be reset! Is this the way to go?
useEffect(() => {
table.resetRowSelection(); // does not work, cause also the initial rowSelection is reset
}, [data]);
useEffect(() => {
table.resetRowSelection(); // does not work, cause also the initial rowSelection is reset
}, [data]);
or should I use the onStateChange-event? If yes, how? An answer from someone who knows better (maybe @KevinVandy 😊 ) would be appreciated. Many thanks
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?