-
Notifications
You must be signed in to change notification settings - Fork 18
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
Is nested path params supported? #128
Comments
After further tinkering around to find out the root cause is PS. Please feel free to close this issue since the problem is solved now. |
Not much is, its just this regex: |
One good reason to support them both being following characters are all legal and supported in an URL?
|
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. |
I'm with @n33pm, I don't see a good reason to match all valid characters, especially characters that cannot be valid JS variable characters, since that's ultimately what this route matcher produces (I know you could use quotes but that seems clunky to me). For the pythonista's I can see why having underscore would be nice. Unfortunately changes to this part of the code constitute a breaking change for the library, so I plan on doing this exactly once. So, I will open a new issue for it where it can be discussed more visibly. |
Actually I agree with everyone here on keeping it simple is good, also not supporting |
I've changed my mind on this and plan to add support for more URL characters. |
Trying to simulate the URL structure like github.com I've got these routes:
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 be222
) 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?
The text was updated successfully, but these errors were encountered: