DEV Community


Discussion on: How to prevent multiple socket connections and events in React

itminhnhut profile image
itminhnhut • Edited

if i have MyComponent and MyComponent2 use socket.on('receive_event', eventHandler);
if MyComponent2 use'receive_event').on('receive_event',()=> function)
is MyComponent have is off after on like MyComponent2 ? .
i want MyComponent2 change socket on is MyComponent no action . How ?.

Forem Open with the Forem app