-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
useRoute in nested Router with basepath cannot match absolute path #244
Comments
@waful i have a doubt, why not distinguish by path, you need to use base? Maybe I didn't understand |
@cbbfcd
I have 2 user types with some shared pages and some type specific pages nested in their respective routers. The settings page for both users are for the most part identical with minor styling/wording changes, so I want to use the same component with a switch flag instead of creating two completely distinct components. I want to be able to identify the nested base route I'm currently in from within EDIT: upon revisiting this problem I wonder if I could just use |
i want made something similar, look exemple:
So what i want is that my If i have selected a item on
I think that I figure out how to work around, with:
So the
Now he matches with base path froim nested router and routes on sub menu. |
When you use
useRoute
in a nestedRouter
withbasepath
specified, the path matching only matches the path portion after the base path. For example, in the following configuration,The
useRoute
insideComponent
cannot match absolute paths like~/test/:rest*
(the wayLink
s can), meaning there is no way to figure out if the current path is under/test
or/othertest
. Looking at the matcher source code, this is just a functionality that has not been implemented. But from a conceptual, functional point of view, is this considered a bug? I would think that there should be a way to match full path without resorting towindow.location.href
?The text was updated successfully, but these errors were encountered: