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

Wildcards in route names #61

Closed
kastork opened this issue Jun 30, 2014 · 3 comments
Closed

Wildcards in route names #61

kastork opened this issue Jun 30, 2014 · 3 comments

Comments

@kastork
Copy link

kastork commented Jun 30, 2014

Is there a notion of a "catch-all" or default route?

Or routes that match based on globs or regular expressions?

@kastork
Copy link
Author

kastork commented Jun 30, 2014

Never mind

<Route name= "" handler = {DefaultView} path="*" />

Seems to do the trick.

@kastork kastork closed this as completed Jun 30, 2014
@srph
Copy link

srph commented May 10, 2015

Sorry for necroing an old thread. I've never see this in the documentation. Can anyone verify?

@dosentmatter
Copy link
Contributor

dosentmatter commented Apr 28, 2018

@srph I'm gonna necro to answer your question.

One way to match is to just not have a path prop

react-router docs says:

Any valid URL path that path-to-regexp understands.

If you look at the package.json of react-router on npm, you will see the dependency "path-to-regexp": "^1.7.0".

The most recent path-to-regxp broke compatibility with the older versions, so that's why react-router stays on "^1.7.0"

No wildcard asterisk (*) - use parameters instead ((.*))

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

3 participants