diff --git a/Libraries/WebSocket/WebSocket.js b/Libraries/WebSocket/WebSocket.js index 551859e2e..12c6e4ad6 100644 --- a/Libraries/WebSocket/WebSocket.js +++ b/Libraries/WebSocket/WebSocket.js @@ -83,8 +83,8 @@ class WebSocket extends EventTarget(...WEBSOCKET_EVENTS) { this._eventEmitter = new NativeEventEmitter(RCTWebSocketModule); this._socketId = nextWebSocketId++; - RCTWebSocketModule.connect(url, protocols, options, this._socketId); this._registerEvents(); + RCTWebSocketModule.connect(url, protocols, options, this._socketId); } close(code?: number, reason?: string): void {