Skip to content
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

It is possible for makePath to return a url that will not be matched by the router #143

Open
TehShrike opened this issue Nov 20, 2020 · 0 comments
Labels

Comments

@TehShrike
Copy link
Owner

Discovered by @Vehmloewff

If you have a parent state with a route parent and a default child state that has an empty string as its route, makePath will return a route /parent but the router will only be listening for a route with a trailing slash /parent/.

Should probably start with a unit test asserting that the output of both those functions match each other.

I'm just guessing, but the best fix might be to change page-path-builder (used in makePath only) to not add a trailing slash when there are empty chunks like that.

Or maybe the root issue is with the arguments being passed to makePath

@TehShrike TehShrike added the bug label Nov 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant