File size: 401 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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>
  </>
)