From e5d4ff202c94e7feda322d188441fe7640ace2cc Mon Sep 17 00:00:00 2001 From: Sruthi Krishnakumar <76727733+SruthiKrish19@users.noreply.github.com> Date: Sat, 25 Jan 2025 14:27:04 +0000 Subject: [PATCH] import missing useState in the useEffect markdown file --- src/content/reference/react/useEffect.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/reference/react/useEffect.md b/src/content/reference/react/useEffect.md index bf148339bca..ba183d3aac3 100644 --- a/src/content/reference/react/useEffect.md +++ b/src/content/reference/react/useEffect.md @@ -23,7 +23,7 @@ useEffect(setup, dependencies?) Call `useEffect` at the top level of your component to declare an Effect: ```js -import { useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { createConnection } from './chat.js'; function ChatRoom({ roomId }) { @@ -81,7 +81,7 @@ Some components need to stay connected to the network, some browser API, or a th To [connect your component to some external system,](/learn/synchronizing-with-effects) call `useEffect` at the top level of your component: ```js [[1, 8, "const connection = createConnection(serverUrl, roomId);"], [1, 9, "connection.connect();"], [2, 11, "connection.disconnect();"], [3, 13, "[serverUrl, roomId]"]] -import { useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { createConnection } from './chat.js'; function ChatRoom({ roomId }) {