Dynamic initialState based on state #3586
Unanswered
AlexMachin1997
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I'm just starting to integrate react-table into a project at work, so far it's been relatively easy to get working even with react-query for server-side data fetching.
Whilst thinking about how I could have used react-table in previous project I was thinking about pre-populating data. I can see you can provide an initialState which is great, though I've only ever seen static examples.
So heres my actual question. If I call useTable and then update the initialState will that update the state internally ?
Example Scenairo:
A user interacts with the table, as they are interacting with the table it's saving those values somewhere weather that is an external api or a local web storage api like sessionStorage.
That user then comes back to the table, useTable is called with a blank initialState, initialState is based on state so if I updated the state would that be reflected by the tables internal state e.g. pageIndex, pageCount, sortBy etc
Any comments are greatly appreciated 😄
Beta Was this translation helpful? Give feedback.
All reactions