swr-site
swr-site copied to clipboard
docs: fix error(typo) on `with-nextjs page` example code
- 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