swr-site icon indicating copy to clipboard operation
swr-site copied to clipboard

docs: fix error(typo) on `with-nextjs page` example code

Open taehyunkim3 opened this issue 7 months ago • 1 comments

  • add missing 'function' on example code.

Updating existing pages ✍️

  • Add missing 'function' on example code.

  • https://swr.vercel.app/docs/with-nextjs

  • BEFORE

'use client'
import useSWR from 'swr'
export default Page() {  //👈missing 'function' here
  const { data } = useSWR('/api/user', fetcher)
  return <h1>{data.name}</h1>
}
  • AFTER
'use client'
import useSWR from 'swr'
export default function Page() {
  const { data } = useSWR('/api/user', fetcher)
  return <h1>{data.name}</h1>
}

Description

  • [ ] Adding new page
  • [x] Updating existing documentation
  • [ ] Other updates

taehyunkim3 avatar Jul 25 '24 03:07 taehyunkim3