T
TanStack3y ago
exotic-emerald

What is the value added of set state functions

I don't really understand the value added of set state function. I was expecting that when I'm using setState, reset, setSorting or others the state inside the table is updated without the need to catch the update with onStateChange and call again createTable. Example with react: UseState for sorting. Pass my sorting into the state with createTable. If I'm using setSorting from table I need to add a function to catch with onSortingChange when state change tjen call setSorting from useState. BUT I can directly call setSorting from UseState.
The only advantage I see is if I have really complex implementation of my table component I don't need to passe setSorting from UseState to my children. In that case I can also use a state manger.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?