Optional parameters in routes
See original GitHub issueIs it possible to have an optional route parameter?
in react-router we had routes like this…
route url /requests/shift(/:id)
which allowed us to both navigate to /requests/shift
and requests/shift/1
im not seeing a documented way to do this with navi, am i just missing something?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top Results From Across the Web
Optional parameters in Web API Attribute Routing
Optional Parameters in Web API Attribute Routing and Default Values: ... You can make a URI parameter as optional by adding a question...
Read more >Angular Routing Parameters (Required Param,Optional ...
These Parameter are used when they are optional and we need to pass complex and multiple parameters . Optional parameter is not used...
Read more >Passing route control with optional parameter after root in ...
I would like to remove the /l/ from my route (to make my url's shorter) and make the :key parameter optional. Would this...
Read more >Passing Optional Parameters to a Route - Rangle.io
Query parameters allow you to pass optional parameters to a route such as pagination information. ... The key difference between query parameters and...
Read more >React Router: Optional Parameters - DigitalOcean
The route will be rendered if it matches the path, with or without the optional parameter. So '/Lyrics/Spoonman' and '/Lyrics/Spoonman/3' would ...
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
Good to know, i’ll give that a shot
It’s possible to achieve a similar result by passing the same matcher to both
/
and/:id
, like so:I don’t think this behaves exactly the same as optional routes, but does it cover your use case?