I'm attempting to create a redirect using router.push
in order to include a query string. However, when I try to pass a special character like a comma as part of the parameter value, it encodes my URL. Can you actually include ',' in a URL using router.push
?
I've experimented with various approaches but haven't been successful in making it function.
router.push({
pathname: router.pathname,
query: { ...router.query, pets: 'cats,dogs'},
})
The resulting URL ends up being myurl?pets=cats%2Cdogs
, but I would prefer it to be myurl?pets=cats,dogs
.