mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
20 lines
401 B
JavaScript
20 lines
401 B
JavaScript
import { useRouter } from 'next/router'
|
|
|
|
export const getServerSideProps = () => {
|
|
return {
|
|
props: {
|
|
hello: 'world',
|
|
random: Math.random(),
|
|
},
|
|
}
|
|
}
|
|
|
|
export default (props) => (
|
|
<>
|
|
<h3 id="gssp">getServerSideProps</h3>
|
|
<p id="props">{JSON.stringify(props)}</p>
|
|
<div id="pathname">{useRouter().pathname}</div>
|
|
<div id="asPath">{useRouter().asPath}</div>
|
|
</>
|
|
)
|