How to properly determine pageCount when doing server-side pagination #2330
Unanswered
Floriferous
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.
Uh oh!
There was an error while loading. Please reload this page.
-
In the FAQ, it is mentioned that you can easily react on pagination changes via a useEffect hook like this:
The problem with this, is it assumes data fetching only occurs because of a table state change. However data can change for outside factors, or even be real-time.
I'd like to know what the recommended pattern is to handle such use-cases?
Let's say that I delete a row via some kind of action, and I refetch my data afterwards with one fewer row, how am I supposed to update the
pageCount
, if I don't have thepageSize
, since that information is in myReactTable
component, below?Is the only solution to keep the
useTable
hook above my data-fetching logic, so that I can use the state of the table directly? This kind of defeats the purpose of a pure Table component that can be enhanced with data-fetching though.Beta Was this translation helpful? Give feedback.
All reactions