-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Which project does this relate to?
Router
Describe the bug
I noticed this issue on pages that have ssr: false
Normally, updating the search params on the same page doesn't cause a remount, just a re-render.
But in the case of ssr: false pages, the first time updating search params (by calling navigate) causes the page to remount.
I tested this by logging useId() hook value which shouldn't change when changing search params, but the first time they are changed it changes too.
See the reproduction below:
Your Example Website or App
https://github.com/MTG2000/tsr-remount-issue/blob/main/src/routes/posts_.%24postId.deep.tsx
Steps to Reproduce the Bug or Issue
- Go to the post deep page
- Check the console log to see the useId value
- Click on
Update Search Paramsbutton & notice that theuseId()value changed - Click again and the useId value will NOT change anymore
Remove the ssr: false option & retry the above steps. You will notice that useId() value will not change at all.
Expected behavior
The page shouldn't remount on search params change.
Screenshots or Videos
20251124-1025-05.6674272.mp4
Platform
- Router / Start Version: 1.139.3
Additional context
No response
Metadata
Metadata
Assignees
Labels
No labels