DEV Community

Discussion on: Buiding Chat App with React Native and Socket.io

Collapse
 
artie profile image
Cyrus Rohail

Hi, I searched about this bug since I had the same problem and I found out that 'require("socket.io")' returns a socket.io Server class. So you can just do const io = require("socket.io")(Port || ExistingHttpServer); and it should work