Skip to content

Commit 1fb9f91

Browse files
Pass options to createConnection in useEffect (#8533)
1 parent 50bdc1e commit 1fb9f91

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/content/reference/react/useEffect.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ function ChatRoom({ roomId }) {
15981598

15991599
useEffect(() => {
16001600
const options = createOptions(); // It's used inside the Effect
1601-
const connection = createConnection();
1601+
const connection = createConnection(options);
16021602
connection.connect();
16031603
return () => connection.disconnect();
16041604
}, [createOptions]); // 🚩 As a result, these dependencies are always different on a commit

0 commit comments

Comments
 (0)