Replies: 1 comment
-
we set data in useReactTable to be [], then later use setOptions to update data. still seems to have it's issues (race conditions where click events happen when there's no data), but mostly works. |
Beta Was this translation helpful? Give feedback.
0 replies
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.
Uh oh!
There was an error while loading. Please reload this page.
-
The docs example for a fully controlled table looks like this:
Now let's say you want your data is dependant on the filter and pagination state.
Your query would look a bit like this
The difficulty is that your
data
depends on thetable
state, but to initialize yourtable
you already need adata
instance.Tanner Linsley says In this issue that we should simply use the
state
variable in our query: #2193 (comment)The problem is that you need an
initialState
with the correct type to initialize thisstate
, or you'll get TypeScript issues when passingstate
andsetState
totable.setOptions
.And in order to get this
initialState
value (or an object with the correct shape) we need atable
instance, right?Any suggestions for a way out of this dependency loop?
Beta Was this translation helpful? Give feedback.
All reactions