How to use the @react-native-community/netinfo.removeEventListener function in @react-native-community/netinfo

To help you get started, we’ve selected a few @react-native-community/netinfo examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CodeRabbitYu / ShiTu / app / components / BaseContainer / index.js View on Github external
useEffect(() => {
    NetInfo.getConnectionInfo().then(networkHandle);
    if (netInfoListen) {
      NetInfo.removeEventListener('connectionChange', networkHandle);
    } else {
      netInfoListen = NetInfo.addEventListener('connectionChange', networkHandle);
    }

    return () => {
      props.store && props.store.hideLoading();
      netInfoListen && NetInfo.removeEventListener('connectionChange', networkHandle);
    };
  });
github celo-org / celo-monorepo / packages / verifier / src / components / HomeScreen / HomeScreen.tsx View on Github external
componentWillUnmount() {
    NetInfo.removeEventListener('connectionChange', this.handleNetworkStatusChange)
  }
github CodeRabbitYu / ShiTu / app / components / BaseContainer / index.js View on Github external
return () => {
      props.store && props.store.hideLoading();
      netInfoListen && NetInfo.removeEventListener('connectionChange', networkHandle);
    };
  });