Skip to content

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

Closed
@DimaAmega

Description

@DimaAmega

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions