Skip to content

[Bug]: revalidate causes page twitching effect while scrolling the page with <ScrollRestoration /> component #13672

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

Open
DimaAmega opened this issue May 25, 2025 · 0 comments · May be fixed by #13671
Labels

Comments

@DimaAmega
Copy link

DimaAmega commented May 25, 2025

I'm using React Router as a...

library

Reproduction

Actually i was trying to setup page with long table (like scrollable page) that constantly refresh data from loader every n ms by calling revalidate(). It works, but using revalidate with <ScrollRestoration /> while scrolling the page causes page twitching.
Without <ScrollRestoration /> component on the page everything is working fine, so i believe this is the bug (i also fixed it)

Minimal example here:
https://stackblitz.com/edit/vitejs-vite-hqtvtb4m?file=README.md

Related issue: #12157

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    react-router: ^7.6.0 => 7.6.0 
    vite: ^6.3.5 => 6.3.5

Used Package Manager

pnpm

Expected Behavior

Screen.Recording.2025-05-25.at.15.58.50.mov

Actual Behavior

Screen.Recording.2025-05-25.at.15.58.22.mov
@DimaAmega DimaAmega added the bug label May 25, 2025
@DimaAmega DimaAmega linked a pull request May 25, 2025 that will close this issue
@DimaAmega DimaAmega changed the title [Bug]: revalidate (from useRevalidator hook) causes page twitching effect while scrolling the page with <ScrollRestoration /> component [Bug]: revalidate causes page twitching effect while scrolling the page with <ScrollRestoration /> component May 25, 2025
@MichaelDeBoey MichaelDeBoey linked a pull request May 25, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant