Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(examples/react): fix prefetch pagination logic when trying to quickly get to the last page #4564

Merged
merged 2 commits into from Nov 30, 2022

Conversation

wojciechSlodziak
Copy link
Contributor

In the useQuery call we set "keepPreviousData", so we must make sure that for fetching the next page we don't base our logic on the data from potentially two pages away.
If user would click very fast to get to the last page we would potentially load the eleventh page and that could result in an error depending on the backend implementation.

…r next page should be refetched on information from two pages prior

 In the useQuery call we set "keepPreviousData", so we must make sure that for fetching the next page we don't base our logic on the data from potentially two pages away.
If user would click very fast to get to the last page we would potentially load eleventh page and that could result in an error depending on the backend implementation.
@wojciechSlodziak wojciechSlodziak changed the title docs(examples/react): fix prefetch pagination logic when trying to quickly get to last page docs(examples/react): fix prefetch pagination logic when trying to quickly get to the last page Nov 28, 2022
@codesandbox-ci
Copy link

codesandbox-ci bot commented Nov 28, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2afbc65:

Sandbox Source
@tanstack/query-example-react-basic-typescript Configuration
@tanstack/query-example-solid-basic-typescript Configuration
@tanstack/query-example-vue-basic Configuration

@TkDodo TkDodo merged commit 23bd564 into TanStack:main Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants