Clarify query string action to matching route map
See original GitHub issueI’m trying to add a query parameter to one of my routes, using:
<Link to={{type: 'SEARCH', payload: {find: this.state.findValue /* string */}}}> Blah </Link>
With the route
{
SEARCH: '/search',
}
Ive also tried adding the query field, dased on these docs:
<Link to={{type: 'SEARCH', payload: {find: this.state.findValue /* string */}}}> Blah </Link>
As well as adding a dynamic field to my route map:
{
SEARCH: '/search/:find',
}
But I can’t seem to get RFR to change my query string for me. I have to do something like
{
SEARCH: '/search?find=:find
}
To get the query string to show up at all. But from your live example it seems that I shouldn’t need to manually code the query string in the route. In addition, I never find my query at store.getState().location.query
after I click my link.
So with that all said, what is the proper mapping between what you supply to Link to={…} and what your route looks like in your routes map, in order RFR create the query string for you?
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (18 by maintainers)
Top Results From Across the Web
How to include Query String in the route resolution in order to ...
I need to include the query parameters when it resolves which route. It should match based on whether orderGUID or id is in...
Read more >Defining Routes - Pedestal
This guide assumes that you understand HTTP requests and URLs. In particular, we make no effort to explain URL-encoding or query strings.
Read more >Traffic management overview for a global external HTTP(S ...
After a pathMatcher is selected based on the host string, the routeRules in the pathMatcher select a URL path. For more information, see...
Read more >Listeners for your Application Load Balancers
You can use query string conditions to configure rules that route requests based on key/value pairs or values in the query string. The...
Read more >URL Dispatch — The Pyramid Web Framework v2.0
When the URL pattern associated with a particular route configuration is matched by a request, a dictionary named matchdict is added as an ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Not yet, it seems that the SSR is getting it right, but the client isn’t for some reason (Turning off JS on the page in dev makes it work!). I’m certainly closer, but I’ll get back to it in the morning. I’m using your demo app as a base if it makes anything come to mind. Thanks for the fast help so far, stoked to get this working!
oh shit. i totally i forgot about that. my bad. i’ll add it now.