Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6] [Bug]: 6.0.0-beta.3 changes relative NavLink behavior #8004

Closed
david-crespo opened this issue Sep 4, 2021 · 6 comments
Closed

[v6] [Bug]: 6.0.0-beta.3 changes relative NavLink behavior #8004

david-crespo opened this issue Sep 4, 2021 · 6 comments
Labels

Comments

@david-crespo
Copy link
Contributor

david-crespo commented Sep 4, 2021

What version of React Router are you using?

v6 beta 3

Steps to Reproduce

Start at root, then click metrics, then click settings.

https://codesandbox.io/s/react-router-v6-beta-3-bug-mh54b?file=/src/App.js

Expected Behavior

In v6 beta 2, you can navigate back and forth between the links and they're all relative to /. So if you click Settings when you're on /metrics you land on /settings.

Actual Behavior

In v6 beta 3, if you click Settings when you're on /metrics you land on /metrics/settings. What's especially odd is that the href on the link is correct (according to my expectation anyway): it says /settings. I have a hunch this is related to #7982.

@chaance chaance added the bug label Sep 4, 2021
@chaance chaance changed the title [Bug]: v6 beta 3 changes relative NavLink behavior [v6] [Bug]: 6.0.0-beta.3 changes relative NavLink behavior Sep 4, 2021
@micha149
Copy link

micha149 commented Sep 7, 2021

I can confirm the same buggy behavior on the Link component…

@Rafael-Dabrowski
Copy link

Me too.

@chaance
Copy link
Collaborator

chaance commented Sep 8, 2021

#8026 should fix Link too 🙂

@hawkcookie
Copy link

#8026 should fix Link too 🙂

@chaance
Thanks for fixing the bug.
useNavigate has the same problem. Will It be solved by #8026 ?

@david-crespo
Copy link
Contributor Author

#8026 should fix Link too 🙂

@chaance
Thanks for fixing the bug.
useNavigate has the same problem. Will It be solved by #8026 ?

Yes. All the changes are in useNavigate.

@david-crespo
Copy link
Contributor Author

Confirmed this is fixed in beta 4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants