React JS SocketIo-Client #4654
Answered
by
darrachequesne
Derrick-Tan-D-WEBDEV
asked this question in
Q&A
-
Hi Guys, Using React v18 currently. Appreciated your help🙏. ` useEffect(() => {
` |
Beta Was this translation helpful? Give feedback.
Answered by
darrachequesne
Mar 8, 2023
Replies: 1 comment 2 replies
-
I think you need to remove the Reference: https://beta.reactjs.org/reference/react/StrictMode |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
darrachequesne
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think you need to remove the
socket.disconnect()
from thecomponentWillUnmount
callback, becauseuseEffect()
is called twice with React 18 Strict Mode.Reference: https://beta.reactjs.org/reference/react/StrictMode