Query in url problem
See original GitHub issueOn my old site I used a bit wired queries in the links, so I need to make my links looks like:
I have route setup for /post/amazing-slug/
Visiting full url on dev-server it loads spinner and gives following error:
getRouteProps could not find any props for route: /post/amazing-slug/?i=b3-cc6d-3e-718c2. Either you are missing a getProps function for this route in your static.config.js or you are using the getRouteProps HOC when you don't need to.
When visiting the same url on exported(build) pages(served via nginx) it’s just white screen but I can see that network request sent back correct response for the route /post/amazing-slug/
Is this a bug or correct behavior? Because if route can’t be handled shouldn’t we serve 404 instead of blanks 😃 ? cheers.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
@EmilTholin should query strings be considered as part of the route path? Or perhaps a fallback if
pathname + search
isn’t found to look for just pathname?I’ve removed all search params from the path matching algo, so you should be free to use them to your advantage. My recommendation for the pagination scenario is to simply not rely on search parameters for static export, and instead use the path.