Skip to content
Source
Sign inSign up
TanStack/router

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

Closedulrichstark(GitHub profile, opens in a new tab) opened this issue 0 comments

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

Sign in to join this conversation.