Allow rows to load their own data? #2991
Unanswered
ianstormtaylor
asked this question in
General
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.
-
Hey @tannerlinsley, I'm trying to figure out if
react-table
can be used for a situation where the data about rows is fetched asynchronously in a hook inside the<Row>
component. This allows for rows to be individually loaded as needed, and for React Suspense to render fallbacks until they've loaded.Consider this pseudo code:
As you can see the rows are self-sufficient and load the data they need.
The trouble is that the
data
of the table is only ever the list ofuserIds
. And sorting or filtering by properties likeuser.name
oruser.email
is not possible with just the IDs. There would need to be some way for the individual rows to tell the table about new metadata associated with a row as it is loaded, so that it could offer sorting abilities and even keep the rows sorted as new data streamed in.Is this possible with
react-table
?I realize this may be more of an architectural question, but I think this pattern would be the ideal for the big picture of how data is loaded, so just curious to see if it's possible.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions