router
router copied to clipboard
Context missing on route preload
Describe the bug
When preloading a route inside a layout, the context defined in beforeLoad on that layout is not there on the first render of the layout when accessing it through Route.useRouteContext().
Your Example Website or App
https://stackblitz.com/edit/github-spzf56?file=src%2Froutes%2F_layout.tsx
Steps to Reproduce the Bug or Issue
- Open Stackblitz
- Hover the
Aboutlink to trigger a preload - Observe app crashing
Expected behavior
I expect the static context defined on beforeLoad to always be available in the component using Route.useRouteContext()
Screenshots or Videos
No response
Platform
- OS: MacOS
- Browser: Arc (Chromium)
- Version: 125
Additional context
No response