Skip to content

Commit e49d0e0

Browse files
Pass options to createConnection in useEffect
1 parent 6be2b02 commit e49d0e0

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)