Skip to content

Commit 4d44167

Browse files
import missing useState in the useEffect markdown file (#7457)
1 parent a5aad0d commit 4d44167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/content/reference/react/useEffect.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ useEffect(setup, dependencies?)
2323
Call `useEffect` at the top level of your component to declare an Effect:
2424
2525
```js
26-
import { useEffect } from 'react';
26+
import { useState, useEffect } from 'react';
2727
import { createConnection } from './chat.js';
2828

2929
function ChatRoom({ roomId }) {
@@ -81,7 +81,7 @@ Some components need to stay connected to the network, some browser API, or a th
8181
To [connect your component to some external system,](/learn/synchronizing-with-effects) call `useEffect` at the top level of your component:
8282
8383
```js [[1, 8, "const connection = createConnection(serverUrl, roomId);"], [1, 9, "connection.connect();"], [2, 11, "connection.disconnect();"], [3, 13, "[serverUrl, roomId]"]]
84-
import { useEffect } from 'react';
84+
import { useState, useEffect } from 'react';
8585
import { createConnection } from './chat.js';
8686

8787
function ChatRoom({ roomId }) {

0 commit comments

Comments
 (0)