Created
December 25, 2016 03:44
-
-
Save vinnyoodles/7c6469b5a0658369d6872e22784d0865 to your computer and use it in GitHub Desktop.
React Native Socket.io Initial Client
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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