mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-23 12:06:47 +08:00
Fix NetInfo RN 0.49 deprecation
This commit is contained in:
@@ -31,7 +31,7 @@ class CoreContainer extends React.Component {
|
||||
NetInfo.isConnected.fetch().then((isConnected) => {
|
||||
this.handleAppStateChange('active'); // Force connect (react debugger issue)
|
||||
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() {
|
||||
AppState.removeEventListener('change', this.handleAppStateChange);
|
||||
NetInfo.isConnected.removeEventListener('change', this.handleNetworkChange);
|
||||
NetInfo.isConnected.removeEventListener('connectionChange', this.handleNetworkChange);
|
||||
}
|
||||
|
||||
props: Props;
|
||||
|
||||
Reference in New Issue
Block a user