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
Double rendering occurs on browser forward/back navigation when using useParams or useSearch hooks. This issue persists even with memoization and affects both Route.useXXX and raw useXXX variants.
Click on the "Search A" and "Search B" links. Observe that only one log entry is printed per navigation.
Use the browser's forward and back buttons to navigate between pages a few times. Notice that two duplicate log entries are printed per navigation.
Navigate to the About page and repeat steps 3-4 to observe the same behavior with params instead of search.
Expected behavior
Components should render only once when navigating using browser forward/back buttons, consistent with the behavior observed when clicking links for navigation.
Screenshots or Videos
No response
Platform
N/A
Additional context
Components do not double render if neither useParams nor useSearch hooks are used.
The issue only occurs when using browser forward/back navigation, not when clicking links.
validateSearch, search middlewares, loaderDeps, and loader do not seem to affect the issue.
Preload settings also do not seem to affect the issue.
Which project does this relate to?
Router
Describe the bug
Double rendering occurs on browser forward/back navigation when using
useParams
oruseSearch
hooks. This issue persists even with memoization and affects bothRoute.useXXX
and rawuseXXX
variants.Your Example Website or App
https://stackblitz.com/edit/tanstack-router-ujjze6?file=src%2Froutes%2Findex.tsx
Steps to Reproduce the Bug or Issue
Expected behavior
Components should render only once when navigating using browser forward/back buttons, consistent with the behavior observed when clicking links for navigation.
Screenshots or Videos
No response
Platform
N/A
Additional context
useParams
noruseSearch
hooks are used.validateSearch
,search
middlewares,loaderDeps
, andloader
do not seem to affect the issue.The text was updated successfully, but these errors were encountered: