-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Closed
Copy link
Labels
Description
What version of React Router are you using?
react-router-dom 6.8.0
Steps to Reproduce
When browser is at a route other than the homepage: eg: /about
, passing a Path object without the pathname key results in different final href values for 6.8.0 vs 6.7.0:
In the examples, click on the "About" link then inspect the "Hash Link" and "Search Link" to see the different href
valeus
// on page with route "/about"
<Link to={{ hash: 'hash' }}>Hash Link</Link>
<Link to={{ search: 'foo=bar' }}>Search Link</Link>
6.8.0 output: example
<a href="https://github.com/#hash">Hash Link</a>
<a href="https://github.com/?foo=bar">Search Link</a>
6.7.0 output: example
<a href="https://github.com/about#hash">Hash Link</a>
<a href="https://github.com/about?foo=bar">Search Link</a>
Expected Behavior
Result in same final href value on 6.8.0 as in 6.7.0
Actual Behavior
final href value is different on 6.8.0 than 6.7.0, resulting in a breaking change
Hypnosphi and david-crespofrankalbenesius