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

Optional path with dash #2735

Closed
mmahalwy opened this issue Dec 17, 2015 · 4 comments
Closed

Optional path with dash #2735

mmahalwy opened this issue Dec 17, 2015 · 4 comments

Comments

@mmahalwy
Copy link

I cannot get this to work:

<Route path="/r/:displayGid(-:seoSlug)" component={Region}/>

returns when visiting /r/123-asd:

{displayGid: '123-asd', seoSlug: undefined}

My solution for now is:

<Route path="/r/:displayGid*-*(:seoSlug)" component={Region}/>

Which returns:

{displayGid: '123', slug: Array[2], seoSlug: 'asd'}
@taion
Copy link
Contributor

taion commented Dec 17, 2015

Subset of #2286.

@taion taion closed this as completed Dec 17, 2015
@mmahalwy
Copy link
Author

@taion sorry, i think I am missing how it's a subset, correct me if I am wrong please :)

@timdorr
Copy link
Member

timdorr commented Dec 17, 2015

That issue, once implemented, will allow you to customize how URLs are matched, including having optional ones.

@mmahalwy
Copy link
Author

@timdorr awesome - really appreciate it!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 22, 2019
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

3 participants