Is it required to control state to use features?
I'm playing around with react-table 8, specifically sorting, and it seems like it's a strict requirement that I need to control the sorting state in order for things to work properly.
It's not clear to me in the documentation that this is necessary. I originally assumed that if I didn't control the state, react-table would handle it's own internal state correctly and the "useReactTable" hook would trigger a re-render. But my testing is leading me to believe that if I want sorting, I must control the "sorting" state.
Is this true or am I doing something wrong? If so, I'd be curious to know if this extends to all features, i.e. in order to use a feature (ex. column visibility) then I must start controlling that particular state.
1 Reply
rare-sapphireOP•3y ago
To answer my question, it appears that it's NOT required to control state in order to get features working.
I was originally getting stricken by a few bugs, specifically this one that causes features to stop working if you are using react dev tools:
https://github.com/TanStack/table/issues/4293
GitHub
State does not update after inspecting data in dev tools · Issue #4...
Describe the bug This could potentially be an issue with React Dev tools however, I am unable to replicate it with any other react code. After opening React Dev Tools and inspecting props/data I am...