mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
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
11 lines
220 B
JavaScript
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
|