I am using Websockets in my React app, and I have to connect to a web socket and then sent a message as soon as it gets connected. but my code do not works in sync
Here it is
ws = new WebSocket(uri);
ws.send('my msg');
Is there a way to wait for connection established and ready state changed! Thanks!