Skip to content

useParams({ strict: false }) return old params #6548

Closed

Description

@Nabellaleen

Which project does this relate to?

Router

Describe the bug

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.

This issue is, maybe, related to #6385

I've tried to reproduce on stackblitz, but didn't get the bug :/

Your Example Website or App

https://stackblitz.com/edit/github-ayayvjap-dghanpul?file=src%2FFooBar.tsx

Steps to Reproduce the Bug or Issue

  • 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

Screenshots or Videos

No response

Platform

  • Router / Start Version: 1.154.8(react-dom@19.2.3(react@19.2.3))(react@19.2.3)
  • OS: macOS
  • Browser: Firefox
  • Browser Version: 147.0.1
  • Bundler: Vite
  • Bundler Version: 7.1.10(@types/node@24.9.2)(jiti@2.6.1)(sass@1.84.0)(terser@5.38.2)(tsx@4.19.3)(yaml@2.8.2)

Additional context

No response

Activity

  1. Nabellaleen commented on Jan 29, 2026

    @Nabellaleen
    Author

    An update to 1.157.16 seems to have fixed the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions