You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
The "onClose" handler is not triggered if the component using "useWs" unmounts #400
Hi,
I just encountered an issue while using your "useWs" implementation.
If a component using "useWs" hook unmount, the "onClose" handler is not called.
The event "close" event is no longer listened to, so if the websocket is closed due to an unmount, the "onClose" handler is never called. The only current solution to this problem is to create a custom cleanup function on unmount which is not ideal as the hook "useWs" already provides one.
Activity