mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
- Enable newNextLinkBehavior. See #36436 - Run next/link codemod on test suite Note that from when this lands on apps trying canary will need to run the new-link codemod in order to upgrade. Ideally we have to detect `<a>` while rendering the new link and warn for it. Co-authored-by: Steven <[email protected]>
37 lines
713 B
JavaScript
37 lines
713 B
JavaScript
import { useRouter } from 'next/router'
|
|
import Link from 'next/link'
|
|
import getConfig from '../lib/config'
|
|
|
|
const localConfig = getConfig()
|
|
|
|
if (localConfig.hello !== 'world') {
|
|
throw new Error('oof import order is wrong, _app comes first')
|
|
}
|
|
|
|
let gspCalls = 0
|
|
|
|
export const getStaticProps = () => {
|
|
gspCalls += 1
|
|
|
|
return {
|
|
props: {
|
|
hello: 'world',
|
|
random: Math.random(),
|
|
gspCalls,
|
|
},
|
|
revalidate: 1,
|
|
}
|
|
}
|
|
|
|
export default function Page(props) {
|
|
const router = useRouter()
|
|
return (
|
|
<>
|
|
<p id="index">index page</p>
|
|
<p id="router">{JSON.stringify(router)}</p>
|
|
<p id="props">{JSON.stringify(props)}</p>
|
|
<Link href="gsp">to /gsp</Link>
|
|
</>
|
|
)
|
|
}
|