kfiroo / react-native-cached-image

CachedImage component for react-native
MIT License
940 stars 468 forks source link

NetInfo listener warning with RN 0.48 #79

Closed pcarion closed 7 years ago

pcarion commented 7 years ago

Even though your code in github did a fix for that (PR), the code from npm (version 1.4.0) is still 'wrong' as it is using the wrong eventName (change instead of connectionChange

NetInfo.isConnected.addEventListener('change', ...)

The listener is also not correct:

handleConnectivityChange(isConnected) {
    this.safeSetState({
        networkAvailable: isConnected
    });
}

The parameter when the listener is called is not a boolean (as you expect in your code) but an enum

kfiroo commented 7 years ago

Thanks @pcarion I will release v1.4.1 soon 👍