How to update sorting on button click
developers-veintestech
CodeSandbox
runtime-resonance-lv2kj0 - CodeSandbox
runtime-resonance-lv2kj0 by developers-veintestech using namor, react, react-dom, react-scripts, react-table, styled-components
2 Replies
wise-white•3y ago
Well it's not updating as that's the initialState, when you update values for that property it won't re-render. It look's like you can override certain pieces of state for table like this https://tanstack.com/table/v8/docs/examples/react/pagination-controlled (Pagination but you can do the same thing for sorting probably). FYI I've not used the new version yet.
React Table Pagination Controlled Example | TanStack Table Docs
An example showing how to implement Pagination Controlled in React Table
generous-apricotOP•3y ago
I am using the version 7 , yeah i was able to achive this via using setSortBy function. same initial state works for hiddenColumns but not for sorting