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
{{ message }}
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Basename Not Included in href for Links in Left Navigation #4556
When a basename is added to React Router,the href in the left-side navigation does not include the basename.
While everything works fine during regular navigation, the path is incorrect when opening links in a new window or tab.
e.g., right-click -> Open link in new tab
Hi, could you please share a reproduction / CodeSandbox or the specific configuration you're using for React Router and the navigation passed to AppProvider?
I wonder if just including the basename in the segments for navigation items would be enough, but if that solution isn't elegant enough we can try to come up with something better.
I wonder if just including the basename in the segments for navigation items would be enough, but if that solution isn't elegant enough we can try to come up with something better.
I believe this will need to be part of the router adapter. the DashboardLayout should not need to know about the basepath.
Hi, could you please share a reproduction / CodeSandbox or the specific configuration you're using for React Router and the navigation passed to AppProvider?
I wonder if just including the basename in the segments for navigation items would be enough, but if that solution isn't elegant enough we can try to come up with something better.
I tried placing the basename in the segments, but after clicking the navigation, it results in two layers of basename (e.g., Clicking "Questions" navigates to /question-bank/question-bank/question instead of /question-bank/question), which directly affects normal navigation behavior.
I tried placing the basename in the segments, but after clicking the navigation, it results in two layers of basename (e.g., Clicking "Questions" navigates to /question-bank/question-bank/question instead of /question-bank/question), which directly affects normal navigation behavior.
I see, I can confirm the issue.
Looks like we will need to add support for basename in the AppProvider for React Router, sorry for the inconvenience and thanks for reporting it!
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
Note
@SilenceLeo How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
Activity
apedroferreira commentedon Dec 24, 2024
Hi, could you please share a reproduction / CodeSandbox or the specific configuration you're using for React Router and the
navigationpassed toAppProvider?I wonder if just including the
basenamein thesegments for navigation items would be enough, but if that solution isn't elegant enough we can try to come up with something better.Janpot commentedon Dec 24, 2024
I believe this will need to be part of the router adapter. the DashboardLayout should not need to know about the basepath.
SilenceLeo commentedon Dec 25, 2024
I tried placing the
basenamein thesegments, but after clicking the navigation, it results in two layers ofbasename(e.g., Clicking "Questions" navigates to/question-bank/question-bank/questioninstead of/question-bank/question), which directly affects normal navigation behavior.apedroferreira commentedon Jan 6, 2025
I see, I can confirm the issue.
Looks like we will need to add support for
basenamein theAppProviderfor React Router, sorry for the inconvenience and thanks for reporting it!github-actions commentedon Feb 24, 2025
This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
Note
@SilenceLeo How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.