-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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] Fix Link and navigate for absolute paths with basename #7462
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@webKity I don't think we should support basename with router nesting for now, @timdorr what do you think ? |
I'd like to see this merged quickly, too. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
pushup, still ongoing problem. |
would be great to see this one merged! :) |
This would be really helpful for me as well. |
Would really appreciate if this one is merged |
To me, this is a critical fix for an unusable version of react-router. Many thanks to the team for reviewing and merging this 🙏 |
Any updates on this? This is also critical for my use case. |
Any ETA on this, when it's going to be merged? It's really helpful if we have some date. |
I have a different use case and the current behaviour actually suits my need. 😅 I'm using a Slot/Fill library to send components into my Layout. Because of that, if I want to use relative const { pathname } = useResolvedPath("");
return (
<>
{props.tabs && (
<Fill name="Layout.Tabs">
<Routes basename={pathname}>
<Route path="*" element={props.tabs} />
</Routes>
</Fill>
)}
</>
) So my components sent to the Layout are still context aware from where they were sent. ⭐ Now with this change, I won't be able to use absolute path as I would do in a normal situation, because of my usage of I now this PR is right and that it is the intended behaviour, but I think my use case is a valid one as well and I'd love having some alternative once this is fixed. 👍 |
Hi, can I know when you guys will release this bug fixing? This would be really helpful for me as well. |
@trangnt1011 There is no scheduled release plan. Just wait a bit and these things will be released. We're still in beta on v6, so you should switch back to the stable release if you're not comfortable with waiting. |
Is this released? |
@harshadray Yes, this was in the v6 beta.1 release: https://github.com/remix-run/react-router/releases/tag/v6.0.0-beta.1 |
Hey @timdorr Thanks for a prompt response. I checked this but I am using useRoutes as suggested here: https://github.com/remix-run/react-router/blob/dev/docs/advanced-guides/migrating-5-to-6.md?ref=morioh.com&utm_source=morioh.com#move-basename-from-router-to-routes Is there any way around to apply basename there? Previously we were able to apply to basename prop there. |
Fixes #7216
Adds test for correct link behaviour under basename