diff --git a/Libraries/WebSocket/WebSocket.js b/Libraries/WebSocket/WebSocket.js index 3fdde2b3639adf..c544e185ecd129 100644 --- a/Libraries/WebSocket/WebSocket.js +++ b/Libraries/WebSocket/WebSocket.js @@ -245,7 +245,12 @@ class WebSocket extends (EventTarget(...WEBSOCKET_EVENTS): any) { data = BlobManager.createFromOptions(ev.data); break; } - this.dispatchEvent(new WebSocketEvent('message', {data})); + const raw_length = ev.raw_length; + if (raw_length == null) { + this.dispatchEvent(new WebSocketEvent('message', {data})); + } else { + this.dispatchEvent(new WebSocketEvent('message', {data, raw_length})); + } }), this._eventEmitter.addListener('websocketOpen', ev => { if (ev.id !== this._socketId) {