Which project does this relate to?
Router
Describe the bug
When using a splat route (/$) with params._splat, navigating between routes requires two clicks to update the loader data. On the first click, the URL updates correctly but the loader runs with stale params._splat from the previous route, causing Route.useLoaderData() to return data for the wrong route.
Your Example Website or App
https://github.com/thuillart/site.git
Steps to Reproduce the Bug or Issue
- Go to
/readings
- Click on
/ai
- Actual: data still shows
/readings
- Click again → data shows
/ai
Expected behavior
As a user, I expected: When I click a link to navigate from /docs/a to /docs/b, the page should immediately show the content for /docs/b with the correct loader data.
But I am seeing: When I click a link to navigate from /docs/a to /docs/b, the URL updates to /docs/b but the page still displays content from /docs/a. I need to click the link a second time (or navigate to another route) before the correct content for /docs/b appears.
Screenshots or Videos
- Go to
/readings
- Click on
/ai
- Actual: data still shows
/readings
- Click again → data shows
/ai
Platform
- Router / Start Version: 1.154.7
- OS: macOS
- Browser: Chrome
- Browser Version: 144.0.7559.60
- Bundler: vite
- Bundler Version: 7.3.1
Additional context
- Works correctly in
@tanstack/react-router@1.153.1
- Broken in
@tanstack/react-router@1.153.2 and later
- The loader is being called but receives stale
params._splat on first navigation
- The URL and
Route.useParams() update correctly, but the loader receives stale params
- This affects any route that depends on
params._splat in the loader
I also opened an issue in Fumadocs where it was determined this is likely a TanStack Router issue rather than a Fumadocs issue.
Which project does this relate to?
Router
Describe the bug
When using a splat route (
/$) withparams._splat, navigating between routes requires two clicks to update the loader data. On the first click, the URL updates correctly but the loader runs with staleparams._splatfrom the previous route, causingRoute.useLoaderData()to return data for the wrong route.Your Example Website or App
https://github.com/thuillart/site.git
Steps to Reproduce the Bug or Issue
/readings/ai/readings/aiExpected behavior
As a user, I expected: When I click a link to navigate from
/docs/ato/docs/b, the page should immediately show the content for/docs/bwith the correct loader data.But I am seeing: When I click a link to navigate from
/docs/ato/docs/b, the URL updates to/docs/bbut the page still displays content from/docs/a. I need to click the link a second time (or navigate to another route) before the correct content for/docs/bappears.Screenshots or Videos
/readings/ai/readings/aiPlatform
Additional context
@tanstack/react-router@1.153.1@tanstack/react-router@1.153.2and laterparams._splaton first navigationRoute.useParams()update correctly, but the loader receives stale paramsparams._splatin the loaderI also opened an issue in Fumadocs where it was determined this is likely a TanStack Router issue rather than a Fumadocs issue.