Multiple connection occours while initializing in React Native
See original GitHub issueI am currently developing a project in React Native. In the version of 3.0.1 socket.io-client, I am trying to connect to a server, it connects multiple times maybe 5 times when the app is opening. I fixed this issue by downgrading the version to 2.1.1.
`Client connected -> ASkjAS35USD Client connected -> WEIAUHB98 Client connected -> KALSKF876 Client connected -> LKKJHJSDNB90
Client disconnected (time out)-> ASkjAS35USD Client disconnected (time out) -> WEIAUHB98 Client disconnected (time out) -> KALSKF876 `
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Data fetching with React Native - LogRocket Blog
In this article, you will learn how to fetch data from an API and display it to the user. We'll cover several approaches...
Read more >Why redux multiple initializing - reactjs - Stack Overflow
Ok, i found the problem. Interesting with my wrong usage createStore function. I was calling in render()
Read more >React.Component
Each component has several “lifecycle methods” that you can override to run code ... This method is called when a component is being...
Read more >React State in Class and Function Components
In class components, there are two ways to initialize state — in a constructor function or as a Class property. Constructor functions, introduced...
Read more >Performance Overview - React Native
Another example is responding to touches: if you are doing work across multiple frames on the JavaScript thread, you might notice a delay...
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
I am facing the same issue with an angular project. I am using version
v3.0.3
ofsocket.io-client
. It connects around 7 times and then starts disconnecting them automatically.For future readers, I suspect this is due to a version incompatibility. I added a note here: https://socket.io/docs/v4/troubleshooting-connection-issues/#The-client-is-not-compatible-with-the-version-of-the-server-1