Files
JJ KasperandGitHub 6233ef7ed8 Correct client rewrite resolving with query (#16860)
This makes sure we only pass the as value's `pathname` instead of the full value so that we don't accidentally include `query` values while resolving the rewrites. This also adds tests to ensure the rewrites are resolved with the correct query values when only providing `href` and when manually mapping them with `href` and `as`

Fixes: https://github.com/vercel/next.js/issues/16825
2020-09-04 19:19:17 +00:00

11 lines
220 B
JavaScript

import { useRouter } from 'next/router'
const Page = () => {
const { query } = useRouter()
return <p id="query">{JSON.stringify(query)}</p>
}
Page.getInitialProps = () => ({ hello: 'GIPGIP' })
export default Page