How to disconnect socket.io on page refresh in React? #4460
Unanswered
ggukggukee
asked this question in
Q&A
Replies: 1 comment
-
Ben??? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When I refresh page new connection is created along side with old one.
I want to socket to disconnect socket on page refresh.
Socket.js
React component useEffect:
Server.js
When you go back, useEffect cleanup works and socket is disconnects but on page refresh disconnect is not working.
Beta Was this translation helpful? Give feedback.
All reactions