title: Why is socket.io slowing my application ? (RN)
body: <p>I'm actually building my mobile application with React-native &amp; React-navigation, and I would like to add a chat to it (in fact I have to do it).</p>
  
  <p>But I'm facing a big issue when connecting my app to Socket.IO:
  All the <em>fetch()</em> requests are soooo slow (10 seconds where it should be 10ms) because of Socket.io. I've seen much explications on the net but nobody seems to be in the exact same situation...</p>
  
  <p>Another problem is that I could solve the problem by doing:</p>
  
  <pre><code>componentWillUnmount() {
      this.socket.disconnect();
  }
  </code></pre>
  
  <p>But because I'm using React-navigation, <em>componentWillUnmount()</em> is never called while navigating between screens...</p>
  
  <p>It looks that the connection with the Websockets is taking too much power, but it's not really possible...</p>
  
  <p>Do you guys have an idea how I should solve this ? Why is Socket.io slowing the <em>fetch()</em> requests ?
  And certainly: <em>Did I do anything wrong</em> ?</p>
  
  <p>I give you a part of my code here below, thank you !</p>
  
  <pre><code>import SocketIOClient from 'socket.io-client';
  
  ...
  
  componentDidMount(){
       this.socket = SocketIOClient('https://api.XXX.com');
  
       this.socket.on('chat', (message) =&gt; {
         this.state.Messages.push(message);
       });
  }
  </code></pre>