mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
24 lines
490 B
JavaScript
24 lines
490 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export default function Page(props) {
|
|
const router = useRouter()
|
|
return (
|
|
<>
|
|
<p id="blog">/blog/[slug]</p>
|
|
<p id="query">{JSON.stringify(router.query)}</p>
|
|
<p id="pathname">{router.pathname}</p>
|
|
<p id="as-path">{router.asPath}</p>
|
|
<p id="props">{JSON.stringify(props)}</p>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export function getServerSideProps({ params }) {
|
|
return {
|
|
props: {
|
|
now: Date.now(),
|
|
params,
|
|
},
|
|
}
|
|
}
|