title: react native check internet connection with NetINFO
body: <p>I implement checking internet on my react-native v0.49 app.
  I'm using NetInfo of react-native.
  I add eventListener when any change happen it will call to function.
  but when i test it in emulator and real device I get only the first change but if I disconnect from Wifi I don't see any change.</p>
  
  <p>internetConnectionPopUp</p>
  
  <pre><code>    import React, { Component } from 'react';
  import {
      View,
      Text,
      NetInfo
  } from 'react-native';
  
  // styles
  import { style } from './style';
  import { globalStyle } from '../../assets/styles/globalStyle';
  
  // redux
  import {connect} from 'react-redux';
  import * as actions from '../../actions';
  
  class InternetConnectionPopUp extends Component {
      constructor(props){
          super(props);
          this.state = { 
              connectionInfo : ''
  
           }
           this.handleFirstConnectivityChange = this.handleFirstConnectivityChange.bind(this);
  
      }  
      handleFirstConnectivityChange(connectionInfo) {
          this.setState({
              connectionInfo: connectionInfo.type
          })
          console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
  
        }
  
      componentWillMount () {
          NetInfo.getConnectionInfo().then((connectionInfo) =&gt; {
              this.setState({
                  connectionInfo: connectionInfo.type
              })
              //console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
            });
  
            NetInfo.addEventListener(
              'connectionChange',
              this.handleFirstConnectivityChange
            );
      }
      componentWillUnmount() {
          NetInfo.removeEventListener(
              'connectionChange',
              handleFirstConnectivityChange
            );
      }
  
  
  
  
      render() {
  
  
          return (
              &lt;View&gt;
                  &lt;Text&gt; ComponentName component &lt;/Text&gt;
                  &lt;Text&gt; { this.state.connectionInfo } &lt;/Text&gt;
              &lt;/View&gt;    
          );
      }
  }
  
  
  export default InternetConnectionPopUp;
  </code></pre>