Unverified Commit ad613e4d authored by hashlash's avatar hashlash Committed by GitHub

[Docs] Add useState and useEffect import (#40944)

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: 's avatarJJ Kasper <jj@jjsweb.site>
parent 377a39a8
...@@ -15,6 +15,8 @@ It's important to note that using client-side data fetching can affect the perfo ...@@ -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. The following example shows how you can fetch data on the client side using the useEffect hook.
```jsx ```jsx
import { useState, useEffect } from 'react'
function Profile() { function Profile() {
const [data, setData] = useState(null) const [data, setData] = useState(null)
const [isLoading, setLoading] = useState(false) const [isLoading, setLoading] = useState(false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment