mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This adds a new test mode `next-deploy` which allows testing against deployments using the Vercel CLI. After running these tests they uncovered some bugs we need to correct before fully enabling. Patching the uncovered issues will be done in follow-up PRs and then after resolved this will be enabled to run after new publishes. Tests that uncovered bugs to patch in follow-ups: - [ ] test/e2e/getserversideprops/test/index.test.ts (req.url normalizing) - [ ] test/e2e/i18n-api-support/index.test.ts (locale prefixed API routes matching) - [ ] test/e2e/prerender.test.ts (/_next/data/build-id/ does not 404)
23 lines
456 B
Plaintext
23 lines
456 B
Plaintext
import { useRouter } from 'next/router'
|
|
|
|
export const getStaticProps = () => {
|
|
return {
|
|
props: {
|
|
nested: true,
|
|
hello: 'hello',
|
|
},
|
|
}
|
|
}
|
|
|
|
export default function Index({ hello, nested }) {
|
|
const { query, pathname } = useRouter()
|
|
return (
|
|
<>
|
|
<p id="nested">{nested ? 'yes' : 'no'}</p>
|
|
<p id="prop">{hello} world</p>
|
|
<p id="query">{JSON.stringify(query)}</p>
|
|
<p id="pathname">{pathname}</p>
|
|
</>
|
|
)
|
|
}
|