Skip to content
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

Named routes? #225

Open
yowzadave opened this issue Feb 22, 2022 · 2 comments
Open

Named routes? #225

yowzadave opened this issue Feb 22, 2022 · 2 comments

Comments

@yowzadave
Copy link

Is it possible to add a name to routes? It would be convenient to be able to supply a "name" property to each defined route, and have that be an accessible property on the location object.

@krishnaTORQUE
Copy link
Collaborator

Could you please give me a example, what you are trying to accomplished. Thanks

@guradia
Copy link

guradia commented Sep 29, 2023

I just started dabbling with this lib, and the first thing I'm missing is exactly this.
I want to do stuff outside of the <Router /> depending on the the activeRoute. Yet i can't, at least not i a concise way.

What i would want is the the option, to

  • give a name: <Route name="home" />
  • obtain the activeRoute outside of <Router />
  • and from that have activeRoute.name in a fully controlled way

If found #185 which refers to the current Location-Object in the Browser, but that is not the ActiveRoute, just a string i then have to parse.

Then i found this: #171, which also asks for the activeRoute, but is links to #255, which ultimately refers to the somewhat new useLocation.

Sadly, useLocation is not usable outside and when used, it's just the Location-Object of the Browser again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants