href value is missing query values to be interpolated properly
// It is important to include ...router.query because there if where the [dynamic] current value is included, so we need to keep it.
// Reference: https://github.com/vercel/next.js/blob/master/errors/href-interpolation-failed.md
const myRedirectFunction = function () {
if (typeof window !== 'undefined') {
router.push({
pathname: router.pathname,
query: {...router.query, myqueryparam: 'myvalue'},
})
}
}
return (
<button onClick={myRedirectFunction}>Continue</button>
)