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
In a layout/pathless route, when using a Link that only updates the search params and uses to=".", it is unexpectedly navigating back to a parent route rather than staying on the same route. This was previously working as expected - the behavior appears to have changed somewhere between v1.81.9 - v1.87.9.
I've setup a minimal example using the pre-configured file-based routing example. I added a Link in the root route, that adds foo: "bar" to the search params, and uses the relative path of "." for the to prop. My understanding is that this Link should only update the search params, and the actual route path shouldn't change. However, it always navigates back to the home page. In previous versions of Router (~1.81.9), this was working as expected.
Go to Stackblitz example above
Click on the About page link. The URL correctly changes to /about.
Click on the Update search only link. The URL changes the search param as expected, but it unexpectedly navigates back to the home page /.
Expected behavior
I expect that a Link component with to="." should always stay on the current route, regardless of whether it is part of a layout/pathless route.
Screenshots or Videos
No response
Platform
OS: macOS
Browser: Chrome
Version: 131
Additional context
No response
The text was updated successfully, but these errors were encountered:
Which project does this relate to?
Router
Describe the bug
In a layout/pathless route, when using a Link that only updates the search params and uses
to="."
, it is unexpectedly navigating back to a parent route rather than staying on the same route. This was previously working as expected - the behavior appears to have changed somewhere between v1.81.9 - v1.87.9.Your Example Website or App
https://stackblitz.com/edit/github-7sawyaq2?file=src%2Froutes%2F__root.tsx
Steps to Reproduce the Bug or Issue
I've setup a minimal example using the pre-configured file-based routing example. I added a
Link
in the root route, that addsfoo: "bar"
to the search params, and uses the relative path of "." for theto
prop. My understanding is that thisLink
should only update the search params, and the actual route path shouldn't change. However, it always navigates back to the home page. In previous versions of Router (~1.81.9), this was working as expected./about
./
.Expected behavior
I expect that a
Link
component withto="."
should always stay on the current route, regardless of whether it is part of a layout/pathless route.Screenshots or Videos
No response
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: