mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 20:23:08 +00:00
docs: Remove serverUrl in code example (#5791)
This commit is contained in:
@@ -672,7 +672,7 @@ This may look like a React error, but really React is pointing out a bug in your
|
||||
To fix the bug, follow the linter's suggestion to specify `roomId` and `serverUrl` as dependencies of your Effect:
|
||||
|
||||
```js {9}
|
||||
function ChatRoom({ roomId, serverUrl }) {
|
||||
function ChatRoom({ roomId }) {
|
||||
const [serverUrl, setServerUrl] = useState('https://localhost:1234'); // serverUrl is reactive
|
||||
useEffect(() => {
|
||||
const connection = createConnection(serverUrl, roomId);
|
||||
|
||||
Reference in New Issue
Block a user