Skip to content

Commit

Permalink
[Docs] Add useState and useEffect import (#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
hashlash and ijjk committed Sep 27, 2022
1 parent 377a39a commit ad613e4
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 ad613e4

Please sign in to comment.