Can I use pushRoute or replaceRoute and specify query parameters via json object?
I've come across this issue too
You can specify query parameters by passing an object in pushRoute or replaceRouter
let params = {a: '1', b: '2', c: '3'}
Router.pushRoute('routeName', params)
In pushRoute the first paramter will be the name of the route defined in your router file
The Documentation specifies that a URL can be used, however i only seem able to get the it working when i use the route-name as @antiproblemist suggested above.
API:
Router.pushRoute(route)
Router.pushRoute(route, params)
Router.pushRoute(route, params, options)
Arguments:
route - Route name or URL to match
Hi @haotangio.
I think that this is the point
https://github.com/fridays/next-routes/blob/master/src/index.js#L172
Nested Objects needs to stringified by qs
@theshaune When route is resolved by URL, there's no params argument.
Authors answer on issue: https://github.com/fridays/next-routes/issues/75#issuecomment-314796343
Most helpful comment
You can specify query parameters by passing an object in
pushRouteorreplaceRouterlet params = {a: '1', b: '2', c: '3'}Router.pushRoute('routeName', params)In pushRoute the first paramter will be the name of the route defined in your router file