Fix NetInfo RN 0.49 deprecation
This commit is contained in:
parent
459b03464d
commit
c1ecf22a38
|
@ -31,7 +31,7 @@ class CoreContainer extends React.Component {
|
||||||
NetInfo.isConnected.fetch().then((isConnected) => {
|
NetInfo.isConnected.fetch().then((isConnected) => {
|
||||||
this.handleAppStateChange('active'); // Force connect (react debugger issue)
|
this.handleAppStateChange('active'); // Force connect (react debugger issue)
|
||||||
this.props.dispatch(setNetworkState(isConnected));
|
this.props.dispatch(setNetworkState(isConnected));
|
||||||
NetInfo.isConnected.addEventListener('change', this.handleNetworkChange);
|
NetInfo.isConnected.addEventListener('connectionChange', this.handleNetworkChange);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ class CoreContainer extends React.Component {
|
||||||
*/
|
*/
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
AppState.removeEventListener('change', this.handleAppStateChange);
|
AppState.removeEventListener('change', this.handleAppStateChange);
|
||||||
NetInfo.isConnected.removeEventListener('change', this.handleNetworkChange);
|
NetInfo.isConnected.removeEventListener('connectionChange', this.handleNetworkChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
props: Props;
|
props: Props;
|
||||||
|
|
Loading…
Reference in New Issue