Is nested path params supported?
See original GitHub issueTrying to simulate the URL structure like github.com I’ve got these routes:
const routes = {
'/': () => <Home />,
'/user': () => <User />,
'/user/:repo': () => <Repo />,
'/user/:repo/issues': () => <Issues />,
'/user/:repo/issues/:issue_id': () => <Issue />,
}
I expect <Issue />
shall be invoked and shown on screen when I visit :
http://localhost:5173/user/repo_foobar/issues/222
and I could access issue_id
(which should be 222
) like this:
const [path, pairs] = usePathParams('/user/:repo/issues/:issue_id')
But for some reasons <Issue />
never showed on screen.
Did I miss something in the route config?
Issue Analytics
- State:
- Created 10 months ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How can you include path parameters in nested router w
When you include the APIRoute to the app instance, it will evaluate all routes and appends them from your dedicated APIRoute to the...
Read more >Path Parameters - FastAPI
OpenAPI doesn't support a way to declare a path parameter to contain a path inside, as that could lead to scenarios that are...
Read more >Detect path parameter type for nested routes from ... - GitHub
To create nested Viewsets, I'm using https://github.com/alanjds/drf-nested-routers Route registration happens like this: router ...
Read more >The Guide to Nested Routes with React Router - ui.dev
In this comprehensive, up-to-date guide, you'll learn everything you need to know about creating nested routes with React Router.
Read more >Nested query | Elasticsearch Guide [8.5] | Elastic
You can search nested fields using dot notation that includes the complete path, such as obj1.name . Multi-level nesting is automatically supported, and ......
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 Free
Top 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
These are only legal and supported URL characters but there is no need do support these characters in the route matcher.
In my humble opinion keep it simple. each additional character ( route matcher ) can lead to unexpected problems.
Actually I agree with everyone here on keeping it simple is good, also not supporting
_
is really not that of a big deal, just make sure to note that in the doc so future users know ahead of time! 🙌