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 #5160

Closed
isergey opened this issue May 23, 2017 · 3 comments
Closed

Named routes #5160

isergey opened this issue May 23, 2017 · 3 comments

Comments

@isergey
Copy link

isergey commented May 23, 2017

Hello. I can't find how to make named routes.

<Router>
    <Route path="/user/:id" name="user" component={UserProfile}  />
</Router>

Then:

<Link to={ name: 'user', params: { id: 123 }}>View profile</Link>

What about this?

@timdorr
Copy link
Member

timdorr commented May 23, 2017

This hasn't existed in React Router since the pre-1.0 days. We aren't adding it back.

@timdorr timdorr closed this as completed May 23, 2017
@vasilakisfil
Copy link

@timdorr how comes? I mean, not all sites are in english (imagine for a redirect having to write Arabic) + you can see all your routes in one place, you don't have to open all files to figure out what's going on.

@pedsmoreira
Copy link

pedsmoreira commented Mar 29, 2018

I created a package for using named routes with react-router-dom v4 - link below

https://github.com/pedsmoreira/named-react-router

If the package doesn't suit your needs, please open an issue or PR and it will be taken into consideration.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 4, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants