version 2.2 does not work with react native
See original GitHub issueReverting to 2.1.1 fixes the problem.
I suspect it has something to do with the new cors management changes. Manually Setting origins does not seem to do anything.
It magically start working when launching the react native debugger.
Config
reconnection: true,
reconnectionDelay: 500,
jsonp: false,
reconnectionAttempts: Infinity,
transports: ['websocket']
Setup
- OS: iOS
- browser: react-native
- socket.io version: 2.2.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:14
- Comments:34 (3 by maintainers)
Top Results From Across the Web
Upgrading to new versions - React Native
Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies.
Read more >React native fetch api does not work with localhost, IP, or even ...
I'm using my mobile device. I tried 127.0.0.1. That didn't work and also I used postman to verify that I'm getting the correct...
Read more >Installation | React Native Reanimated - Software Mansion
Reanimated 2 is primarily built in C++ using Turbo Modules infrastructure which is not yet completely deployed in React Native (specifically on Android)....
Read more >@react-native-picker/picker - npm
React Native Picker for iOS, Android, macOS, and Windows. Latest version: 2.4.8, last published: 2 months ago.
Read more >Introducing Hooks - React
React 16.8.0 is the first release to support Hooks. When upgrading, don't forget to update all packages, including React DOM. React Native has...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Nothing seems like to be working with react native 0.60
socket.io (unlike the WebSocket API) only accepts a HTTP(S) protocol URI for the client (see the docs here), but it does use the WS protocol behind the scenes.
So if you do
io('http://192.168.0.107:8080/endpoint', ...)
it should work!