mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
28 lines
440 B
JavaScript
28 lines
440 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export default function Page() {
|
|
const router = useRouter()
|
|
|
|
return (
|
|
<>
|
|
<p id="slug">top level slug {router.query.slug}</p>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const getStaticProps = () => {
|
|
return {
|
|
props: {
|
|
hello: 'world',
|
|
random: Math.random(),
|
|
},
|
|
}
|
|
}
|
|
|
|
export const getStaticPaths = () => {
|
|
return {
|
|
paths: ['/world', '/top-level-slug'],
|
|
fallback: false,
|
|
}
|
|
}
|