catch-all parameter support
See original GitHub issueHi! I’m curious if there’s an easy way to catch the whole URL path, including slash character.
E.g. by using single handler component:
<Route path="/:path" component={Test} />
I want to catch the whole path into the path
parameter, including slash character, e.g. /project
and /project/test
This behavior is not handled properly by default.
For now I managed to make a dirty workaround:
<Route path="/:path" component={PageView} />
<Route path="/:path/:subpath" component={PageView} />
Do you have any hint on more proper way to achieve it?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Custom catch-all parameter in routing - asp.net - Stack Overflow
A class has been written that supports this. I've written such a class that can handle catch-all segment anywhere in the URL. There's...
Read more >Support for catch-all parameter syntax · Issue #1100 - GitHub
When sending a request via SwaggerUI, parameter bar will be escaped. In this case, all '/' will be replaced with %2F . Steps...
Read more >Catch-All Parameters in ASP.NET Core MVC 6 - YouTube
In this video we'll learn how to define catch-all parameters for our routes. Also, we'll see how to configure a simple 404 page....
Read more >Catch-all parameter (routing) and Request.Url.Path - MSDN
Hello Gentlemen,. I would ask you about some issues related to routing in asp.net mvc. ... As you can see I use catch-all...
Read more >Dynamic Routes - Next.js
However, route parameters will override query parameters with the same name. ... Catch all routes can be made optional by including the parameter...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you for the great suggestion @aherok. The support for naming wildcards was added in
1.1.0
.Oh, I didn’t get your question.
In some other router package I’ve seen something like:
Which was just catching the whole path to the
path
parameter. Similar option here would be even better than just passing the asterisk alone as it would not require using$$props
object.