T
TanStack3y ago
generous-apricot

How to update sorting on button click

heres sand box link https://codesandbox.io/s/runtime-resonance-lv2kj0 Same for group by .
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
wise-white3y 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-apricot
generous-apricotOP3y 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

Did you find this page helpful?