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

Commits on Nov 28, 2022

  1. bugfix/pagination-example-fetch-next-page: fix basing decision whethe…

    …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 committed Nov 28, 2022
    Copy the full SHA
    390598a View commit details
    Browse the repository at this point in the history

Commits on Nov 30, 2022

  1. bugfix/pagination-example-fetch-next-page: update useEffect dependenc…

    …y array to reflect all used variables
    wojciechSlodziak committed Nov 30, 2022
    Copy the full SHA
    2afbc65 View commit details
    Browse the repository at this point in the history