mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
24 lines
479 B
JavaScript
24 lines
479 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export const getServerSideProps = ({ params }) => {
|
|
return {
|
|
props: {
|
|
hello: 'world',
|
|
slug: params.slug,
|
|
random: Math.random(),
|
|
},
|
|
}
|
|
}
|
|
|
|
export default function Page(props) {
|
|
const router = useRouter()
|
|
return (
|
|
<>
|
|
<p id="dynamic">dynamic page</p>
|
|
<p id="slug">{props.slug}</p>
|
|
<p id="router">{JSON.stringify(router)}</p>
|
|
<p id="props">{JSON.stringify(props)}</p>
|
|
</>
|
|
)
|
|
}
|