You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
useParams({ strict: false }) return old params #6548
After a navigation from a foo/${fooId} route to a bar/${barId} route rendering the same page component, a call to useParams({ strict: false }) is returning both fooId and barId
This prevent me to be able to know on which route the user really is.
I'm on mypage/foo/${fooId}, which implement a MyPage component, using const params = useParams({strict: false}) to get the fooId
I use router.navigate('mypage/bar/${barId}') to navigate with a route also using the MyPage component
=> params contient { fooId: 'XXX', barId: 'YYY' }
If I use useMatch in MyPage to get a more detailed match, I can access to the _strictParams which has the right value ({ barId: 'YYY' }).
I've tried with and without structuralSharing in useParams
And also tried with replace: true in navigate
Investigating with useRouterState, I can see :
location._matchSnapshot and resolvedLocation._matchSnapshot contains old value, in params and parsedParams
but none of the matches nor routeIds contains the old match
Expected behavior
I expect to get, in params returned by useParams or other hooks, the params which really are in the route
Activity
Nabellaleen commentedon Jan 29, 2026
An update to
1.157.16seems to have fixed the issue