Skip to content

Commit

Permalink
[Docs] Add useState and useEffect import (vercel#40944)
Browse files Browse the repository at this point in the history
It makes copy-pasting the code easier since the person will be aware of
the import

<!--
Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change that you're making:
-->

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing
doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)

Co-authored-by: JJ Kasper <jj@jjsweb.site>
  • Loading branch information
2 people authored and BowlingX committed Oct 5, 2022
1 parent fd6487b commit 0734842
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/basic-features/data-fetching/client-side.md
Expand Up @@ -15,6 +15,8 @@ It's important to note that using client-side data fetching can affect the perfo
The following example shows how you can fetch data on the client side using the useEffect hook.

```jsx
import { useState, useEffect } from 'react'

function Profile() {
const [data, setData] = useState(null)
const [isLoading, setLoading] = useState(false)
Expand Down

0 comments on commit 0734842

Please sign in to comment.