-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
react-router-config matchRoutes matches incorrectly when using query params #5132
Comments
@michaelBenin are you creating a PR for this? would be interested in giving this a go if not |
There currently isn't a way to match the search part of the URL. We use
So, this isn't something we can support on our end. In addition, we don't process the query string at all anymore, so there isn't really a good way to handle this yet. This can likely be solved with something like #4962, where you could set up a Since it's heavily related to that, I'll close this out in favor of that issue. A PR for it would be awesome! |
That's how we got around it by using the path instead of the entire url. |
But it's dependent on query variable order at that point, so it's brittle behavior. Instead, you should pass off the location to a function that can parse the query string and do whatever logic you want, including checking against external resources. Bonus points for a |
Tomorrow morning we are releasing the new https://www.fastcompany.com/ all converted to react-router v4. On this page: https://github.com/ReactTraining/react-router/tree/master/packages/react-router-config Where it states:
I'd be happy to share how we were able to migrate from v3 to v4 replacing onEnter with using |
@nowy I'm not creating a pr. My team is using the path instead of full url. Thank you. |
Version
1.0.0-beta.3
Test Case
Test case not available as unpkg is broken see this issue: #5130
Steps to reproduce
Example:
Expected Behavior
Matches /search
Actual Behavior
Matches nothing.
The text was updated successfully, but these errors were encountered: