-
-
Notifications
You must be signed in to change notification settings - Fork 10.6k
matchPath not working with queryParams in url #5285
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
Comments
That's a typo. You should be putting |
@timdorr But then how do I get queryParams out of it inside my routes loadData function if the path is just the url without the queryParams? EDIT: Clarity - props doesn't contain queryParams so I can't get them inside the Routes loadData call in. |
You'll need to get the search into the returned match's location. Then you can parse it with whatever query parsing library you want. |
@timdorr Can you point me into the right direction to do that? |
Sorry, I misspoke. |
@timdorr is it possible to update the docs so that it specifies that https://reacttraining.com/react-router/web/guides/server-rendering |
A PR would be the best way to get that fixed. |
URL's with query strings don't get matched correctly when using `req.url`. `req.path` is required instead. remix-run#5285
URL's with query strings don't get matched correctly when using `req.url`. `req.path` is required instead. remix-run#5285
So after reading #4410 it looks like you can't parse query params just by using react-router-v4.
I now have an issue that means my server-side data fetching doesn't work (after following https://reacttraining.com/react-router/web/guides/server-rendering) because the matchPath function doesn't match if you supply query params in the request?
Is there a solution for this?
Or have I simply encountered a bug relating to matchPath?
Example:
The text was updated successfully, but these errors were encountered: