Skip to content

Instantly share code, notes, and snippets.

@vinnyoodles
Created December 25, 2016 03:44
Show Gist options
  • Save vinnyoodles/7c6469b5a0658369d6872e22784d0865 to your computer and use it in GitHub Desktop.
Save vinnyoodles/7c6469b5a0658369d6872e22784d0865 to your computer and use it in GitHub Desktop.
React Native Socket.io Initial Client
import React from 'react';
import SocketIOClient from 'socket.io-client';
class Main extends React.Component {
constructor(props) {
super(props);
// Creating the socket-client instance will automatically connect to the server.
this.socket = SocketIOClient('http://localhost:3000');
}
}
module.exports = Main;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment