File size: 343 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import useSWR, { useSWRConfig } from 'swr'

export default function Page({ foo }) {
  const { data } = useSWR('hello', (v) => v, { fallbackData: 'hello' })
  useSWRConfig() // call SWR context

  return <div id="content">{`${data}-${foo}`}</div>
}

export function getServerSideProps() {
  return {
    props: {
      foo: 'bar',
    },
  }
}