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
Hello.
I have used socket.io and it worked fine on the client side, until I stuck with one "bug", I guess.
Following example is very simplified, but the idea is the same.
I do not know what is the problem here. Maybe, there is not way in socket.io to use multiple handlers for one event. I didn't find any examples on that topic.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I have used socket.io and it worked fine on the client side, until I stuck with one "bug", I guess.
Following example is very simplified, but the idea is the same.
In one component I use:
In another component I use:
So, I do not get any of that event, but there is also socket.any((event) => console.log(event)) and it gives me proper event name.
Interestingly enough, there is also new connection established after event is registered, but with the same socketId.
That I know because of:
I do not know what is the problem here. Maybe, there is not way in socket.io to use multiple handlers for one event. I didn't find any examples on that topic.
Beta Was this translation helpful? Give feedback.
All reactions