rsnext/test/integration/custom-routes/pages/auto-export/[slug].js
JJ Kasper 65588083db
Ensure query for static pages with rewrites is updated correctly (#24189)
This updates the query refreshing on the client to also refresh when rewrites are used and the page is static since additional query values can be provided from rewrites that are relied on client-side. An additional test has been added in the custom-routes suite to ensure this is working correctly. 

## Bug

- [x] Related issues linked using `fixes #number`
- [x] Integration tests added

Fixes: https://github.com/vercel/next.js/issues/23490
Fixes: https://github.com/vercel/next.js/issues/22931
Fixes: https://github.com/vercel/next.js/issues/21062
2021-04-18 10:00:04 +00:00

11 lines
252 B
JavaScript

import { useRouter } from 'next/router'
export default function Page() {
const router = useRouter()
return (
<>
<p id="auto-export">auto-export {router.query.slug}</p>
<p id="query">{JSON.stringify(router.query)}</p>
</>
)
}