router icon indicating copy to clipboard operation
router copied to clipboard

`<ScrollRestoration />` does not restore the scroll positions before DOM paint

Open xiaodan999 opened this issue 1 year ago • 0 comments

Which project does this relate to?

Router

Describe the bug

It shows the top of the page then restore the scroll positions. This causes flickering.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-k6ncqr?file=src%2Fmain.tsx

Steps to Reproduce the Bug or Issue

  1. At the / route (Home tab), scroll to the bottom of the home tab.
  2. Click the About tab.
  3. Click the Home tab.
  4. I can see the red background of the Home tab title appear and then suddenly disappeared.

Expected behavior

No red background flickering

Screenshots or Videos

https://github.com/user-attachments/assets/22f05924-bb58-4894-9938-5a7903b51db4

Platform

  • OS: WInd
  • Browser: Edge
  • Version: 130.0.2849.46

Additional context

No response

xiaodan999 avatar Oct 20 '24 18:10 xiaodan999