mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
28 lines
581 B
JavaScript
28 lines
581 B
JavaScript
export default function Home(props) {
|
|
return <pre id="props">{JSON.stringify(props)}</pre>
|
|
}
|
|
|
|
export async function getStaticPaths() {
|
|
return {
|
|
paths: [
|
|
{ params: { slug: false } },
|
|
{ params: { slug: ['a'] } },
|
|
{ params: { slug: ['hello', 'world'] } },
|
|
],
|
|
fallback: false,
|
|
}
|
|
}
|
|
|
|
export async function getStaticProps({ params, revalidateReason }) {
|
|
console.log(
|
|
`getStaticProps({ revalidateReason: ${JSON.stringify(revalidateReason)} })`
|
|
)
|
|
return {
|
|
props: {
|
|
params,
|
|
random: Math.random(),
|
|
},
|
|
revalidate: 1,
|
|
}
|
|
}
|