Replies: 2 comments 6 replies
-
I can easily support this. What are all of the different flavors and use cases you would what to see? |
Beta Was this translation helpful? Give feedback.
6 replies
-
Our team has a use case as well and similar functionality as Vue's router, which uses path-to-regexp would be enough. We need to use a similar path for two different routes, and a regex match would let us match one to a Mongo ID vs the other with just a simple id. It would look something like this: const routes = [
{ path: ':post([a-f\d]{24})', ... }, // matches a 24 char mongo ID
{ path: ':org', ... } // matches everything else
]; |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
In the previous version (v5) of React-Router, they allowed the ability to specify somewhat complex regex expressions for the router to match on. I bring this up here because I know this project started as a branch off of their latest version but they don't support that anymore, or at least not yet. I feel like this is a decent sized problem for those coming from v5. So, my question is this, did you happen to bring that forward in react-location?
Example:
/:segment(a|b|c)/:id(\\d+)
Beta Was this translation helpful? Give feedback.
All reactions