Skip to content
Advertisement

Tag: socket.io

Why React js receive multiple answer from server with Socket.io?

When emit a event to the websocket server, the server receive the event once and send a response, but the client receive the event multiple time: result expected result received client side: server side : Answer UPDATE: on the client side I got to put the socket.on(‘response,()=>{…}) in the UseEffect of the component and add a socket.off in the return

Advertisement