Skip to content

Pending Component does not receive scroll restoration logic #7749

Description

@alex-delia

Which project does this relate to?

Router

Describe the bug

When scrolled down on a page and linking to another, the pending component appears scrolled to the bottom, as opposed to being at the top on first load. The page then jumps to the top at the end of the pending period.

Complete minimal reproducer

https://stackblitz.com/~/github.com/alex-delia/profile-scroll-reset-repro

Steps to Reproduce the Bug

  1. Go to Reproduction
  2. Scroll to Bottm of index page
  3. Click Link to next page
  4. Observe pending component showing the bottom instead of top of the page

This also includes a potential workaround where It uses the router's 'onBeforeNavigate' event to scroll to the top of the page

Expected behavior

Scroll restoration currently executs in the onRendered stage of the router's events. This means anything like pending components dont receive the expected scrolling behaviour on load. I would expect the pending component to match the actual components logic, so things like full page skeleton loaders work properly.

Screenshots or Videos

Screen.Recording.2026-07-05.at.11.07.02.PM.mov

Platform

  • Router / Start Version: @tanstack/react-router 1.170.17 (router-core 1.171.14). TanStack Start: N/A
  • OS: macOS 15.7.7
  • Browser: Google Chrome
  • Browser Version: 149.0.7827.201
  • Bundler: Vite
  • Bundler Version: 6.4.3

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions