New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to import an instance of "io" in socket.io-client in ES6? #1055
Comments
Doing |
import ioClient from 'socket.io-client'
let io = ioClient('http://your-host') |
how do you pass options in this case? |
Try doing something like this: `import express from 'express'; let app = express(); |
Importing doesnt work. It says fetch module import failed |
This should work.
|
Sorry to bring up this here. I couldn't find any information of importing it in ES6 syntax. Is it supported now? Do I have to use
require('socket.io-client')
? If I useimport * as io from 'socket.io-client'
I have to useio.connect('localhost')
. But if I userequire('socket.io-client')
I just need to useio('localhost')
.The text was updated successfully, but these errors were encountered: