next.js/test/production/standalone-mode/basic/pages/hello.js
hello.js17 lines343 B
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',
    },
  }
}
Quest for Codev2.0.0
/
SIGN IN