-
-
Notifications
You must be signed in to change notification settings - Fork 51
Pagination crashes when data is updated #52
iakovalgaev
started this conversation in
General
-
Let's say I'm on the fifth page. I do some action after which I request updated data. When they come, it throws me from the fifth to the first page. I would like to be in control of this moment.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
I'm sorry. I hurried and did not notice one moment. Tables thus retain page position by default.
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
Yes, the page keeps staying at the position. If new data comes in and you want to do something about the page, you can use the imperative API. Something like:
const pagination = usePagination(...);
React.useEffect(() =>
if (data !== previousData) {
pagination.fns.onSetPage(0);
}
, [data]};
Beta Was this translation helpful? Give feedback.
All reactions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment