use-socket.io-client
React(^16.8.0) hook for socket.io-client, manipulate socket.io client without any side effect.
//In legacy, you would write like this:;socket = ; //Now, you could easily write this inside the body of a function component:;const socket =
Installation
$ npm i use-socket.io-client
Example
; //You can treat "useSocket" as "io"const socket = ; //connect socketsocket; //add eventsocket; //emitsocket;