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
Go to /abc/topics/1 in the sandbox to see the issue.
Steps to reproduce
Rerender a Link without remounting it inside a Router with a basename. The link must be using a string for the to param. If it uses the object syntax it will work. No idea why those are different. There may be more, but this is all I've narrowed it down to at the moment.
Expected Behavior
The link renders the given to relative to the current basename. rerenders don't change the link's href.
Actual Behavior
Basically, every rerender the link adds the current basename onto itself, but it already has a basename, so it just grows indefinitely. E..g with basename abc
render 1: /abc/x/1
render 2: /abc/abc/x/1
render 3: /abc/abc/abc/x/1
etc...
The text was updated successfully, but these errors were encountered:
AHBruns
changed the title
[v6] [Bug] Link generated href is wrong
[v6] [Bug] Link generated href is wrong on rerenders when using a basename
Oct 17, 2021
AHBruns
changed the title
[v6] [Bug] Link generated href is wrong on rerenders when using a basename
[v6] [Bug] Link is wrong on rerenders when using a basename
Oct 17, 2021
Version
6.0.0-beta.6
Test Case
https://codesandbox.io/s/react-router-v6-link-w-basename-bug-report-bhyn8?file=/index.js
Go to
/abc/topics/1
in the sandbox to see the issue.Steps to reproduce
Rerender a Link without remounting it inside a Router with a basename. The link must be using a string for the
to
param. If it uses the object syntax it will work. No idea why those are different. There may be more, but this is all I've narrowed it down to at the moment.Expected Behavior
The link renders the given
to
relative to the current basename. rerenders don't change the link's href.Actual Behavior
Basically, every rerender the link adds the current basename onto itself, but it already has a basename, so it just grows indefinitely. E..g with basename abc
render 1: /abc/x/1
render 2: /abc/abc/x/1
render 3: /abc/abc/abc/x/1
etc...
The text was updated successfully, but these errors were encountered: