Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pagination crashes when data is updated #52

iakovalgaev started this conversation in General
Discussion options

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.

You must be logged in to vote

Replies: 1 comment 1 reply

Comment options

I'm sorry. I hurried and did not notice one moment. Tables thus retain page position by default.

You must be logged in to vote
1 reply
Comment options

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]};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /