Closed Sergey2095 closed 1 year ago
I have the same problem. Since next.js
is using querystring
to parse the url, an array as a query param cannot be parsed anymore.
Having an array as a query property: { key: [1,2,3] }
gets this url: http://locahost:xxxx/path?key=1%2F2%2F3
Using the withRouter
from next/routes
the query
has a string value then:
{ key: "1/2/3" }
instead of parsing an array again.
Why can't you use the querstring.stringify
function instead to be aligned with next.js
?
with 'next/router' we can write Router.push({ pathname: pathname, query: { key:[1,2,3] } });