Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[README.md] Error in sample code at 'SSR with Next.js' #151

Closed
zeroslope opened this issue Nov 27, 2019 · 0 comments · Fixed by #152
Closed

[README.md] Error in sample code at 'SSR with Next.js' #151

zeroslope opened this issue Nov 27, 2019 · 0 comments · Fixed by #152

Comments

@zeroslope
Copy link
Contributor

Sample code at '#ssr-with-nextjs'
https://github.com/zeit/swr/blob/master/README.md#ssr-with-nextjs
https://github.com/zeit/swr/blame/master/README.md#L359-L362

current code

App.getInitialProps = async getInitialProps () {
  const data = await fetcher('/api/data')
  return { data }
}

it may be

App.getInitialProps = async function getInitialProps () {
  const data = await fetcher('/api/data')
  return { data }
}

or

App.getInitialProps = async () => {
  const data = await fetcher('/api/data')
  return { data }
}
zeroslope added a commit to zeroslope/swr that referenced this issue Nov 27, 2019
shuding pushed a commit that referenced this issue Nov 27, 2019
wroy7860 added a commit to wroy7860/ReactandNode-develop-swr-core-infinate- that referenced this issue Sep 19, 2022
johnfrench3 pushed a commit to johnfrench3/swr-react-dev that referenced this issue Nov 2, 2022
renawolford6 added a commit to renawolford6/swr-core-test-javascript that referenced this issue Nov 10, 2022
codechieflee added a commit to codechieflee/react-hook-swr that referenced this issue Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant