Skip to content

Commit a1a787f

Browse files
committed
fix(WebSocketExample): 'blob' is not yet supported in RNW
1 parent a94d610 commit a1a787f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

js/WebSocketExample.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const ReactNative = require('react-native');
1818
const {
1919
Image,
2020
PixelRatio,
21+
Platform,
2122
ScrollView,
2223
StyleSheet,
2324
Text,
@@ -69,7 +70,7 @@ class WebSocketImage extends React.Component {
6970
state: {blob: ?Blob} = {blob: null};
7071
componentDidMount() {
7172
let ws = (this.ws = new WebSocket(this.props.url));
72-
ws.binaryType = 'blob';
73+
ws.binaryType = Platform.OS === 'windows' ? 'arraybuffer' : 'blob';
7374
ws.onmessage = event => {
7475
if (event.data instanceof Blob) {
7576
const blob = event.data;

0 commit comments

Comments
 (0)