Skip to content

Context value coming from beforeLoad isn't propagated to sub-route while loader of sub-route is executing #7602

@ulrichstark

Description

@ulrichstark

Which project does this relate to?

Router

Describe the bug

Context value coming from beforeLoad isn't propagated to sub-route while loader of sub-route is executing

Complete minimal reproducer

https://github.com/ulrichstark/tanstack-repro-context-value-not-propagated-while-loader-is-executing

Steps to Reproduce the Bug

Setup:

git clone https://github.com/ulrichstark/tanstack-repro-context-value-not-propagated-while-loader-is-executing
cd tanstack-repro-context-value-not-propagated-while-loader-is-executing
npm i
npx vite

Then:

  1. Go to http://localhost:3000/repro
  2. Click on "Home" link in the page
  3. Use the browser's back button

Expected behavior

The /repro should immediately render number as 42 and never as undefined.

Screenshots or Videos

No response

Platform

  • Router / Start Version: [e.g. 1.121.0]
  • OS: [e.g. macOS, Windows, Linux]
  • Browser: [e.g. Chrome, Safari, Firefox]
  • Browser Version: [e.g. 91.1]
  • Bundler: [e.g. vite]
  • Bundler Version: [e.g. 7.0.0]

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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