React Native and

React Native finally supports Websockets. Which is awesome, however there is one gotcha with

  1. npm install This will just pull down the javascript client

  2. Everything works great but there is one issue that window.navigator.userAgent doesn't exist. Socket.IO checks to deal with some browser incosistencies but we don't care. So all we have to do is create it. However make sure you require react-native first!

Just like so

window.navigator.userAgent = "react-native";

var io = require("");

Now you can do as you please with your new glorious websockets.

Discord Logo

Code Daily Discord

Join our community and get help with React, React Native, and all web technologies. Even recommend tutorials, and content you want to see.