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
Hovering a link while preloading is enabled for the router, will cause the loader to run with the cached cause value from the last the the route loader was cached.
If you refer to my reproduction, when loading to the / route and refer to the console logs, we can see that cause is always enter every time the "home" link is hovered. If we loaded the page on /about it is first preload and then correctly updates to enter when visiting /, but once on the page, and continuing to hover the home button, the cause remains as enter instead of stay.
Notice I have the version of the router set to 1.87.0. This looks to work find in 1.86.0 but all newer versions (tested all minor versions from 1.87 -> 1.97.1` with the same issue).
If I had to make an educated guess at what introduced this, I'd say commit 941ff2d probably had something to do with it, specifically line 2855 where we are no longer updating currently matched matches (which presumably causes cause to no longer get updated with "stay" because it's being skipped under that condition).
Not sure on a simple fix for this one since I am sure removing this condition will probably break existing features.
Observe the console printing cause: enter instead of cause: stay
Expected behavior
Go to Home (/)
Hover the Home button
Observe the console printing cause: stay
Screenshots or Videos
Platform
OS: Windows 11
Browser: Arc
Version: 1.87.0 -> 1.97.1
Additional context
Noticed this since our application has some redux actions in our loader that should only run when navigating to the page for the first time, however after upgrading, would cause them to run every time someone hovered a link on the page, which would also show a full page loader (and if the mouse was not moved from where the link would re-render after the loader, this would repeat indefinitely)
The text was updated successfully, but these errors were encountered:
Which project does this relate to?
Router
Describe the bug
Hovering a link while preloading is enabled for the router, will cause the loader to run with the cached
cause
value from the last the the route loader was cached.If you refer to my reproduction, when loading to the
/
route and refer to the console logs, we can see thatcause
is alwaysenter
every time the "home" link is hovered. If we loaded the page on/about
it is firstpreload
and then correctly updates toenter
when visiting/
, but once on the page, and continuing to hover the home button, thecause
remains asenter
instead ofstay
.Notice I have the version of the router set to
1.87.0
. This looks to work find in1.86.0
but all newer versions (tested all minor versions from 1.87 -> 1.97.1` with the same issue).If I had to make an educated guess at what introduced this, I'd say commit
941ff2d
probably had something to do with it, specifically line 2855 where we are no longer updating currently matched matches (which presumably causescause
to no longer get updated with "stay" because it's being skipped under that condition).Not sure on a simple fix for this one since I am sure removing this condition will probably break existing features.
Thanks in advance
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-lddmwspa?file=src%2Froutes%2Findex.tsx
Steps to Reproduce the Bug or Issue
/
)cause: enter
instead ofcause: stay
Expected behavior
/
)cause: stay
Screenshots or Videos
Platform
Additional context
Noticed this since our application has some redux actions in our loader that should only run when navigating to the page for the first time, however after upgrading, would cause them to run every time someone hovered a link on the page, which would also show a full page loader (and if the mouse was not moved from where the link would re-render after the loader, this would repeat indefinitely)
The text was updated successfully, but these errors were encountered: