mirror of
https://github.com/status-im/react-native.git
synced 2025-02-25 15:45:32 +00:00
Update the NetInfo.isConnected
example code so that it uses the new connectionChange
event
Summary: The first code block already uses the new `connectionChange` event instead of the deprecated `change` event, so change this example code block as well to use the new event. I came across this while upgrading my RN version. In the debug-console I saw a deprecation warning, despite I was using the example-code. Looking at the source, I saw the example code block still used the deprecated event, so update it to use the new one. Closes https://github.com/facebook/react-native/pull/16357 Differential Revision: D6054428 Pulled By: hramos fbshipit-source-id: 72ef1a79ece7494cda3773461a740dbbdf383e7e
This commit is contained in:
parent
a59d157df4
commit
8b044dcb80
@ -158,12 +158,12 @@ const _isConnectedSubscriptions = new Map();
|
||||
* function handleFirstConnectivityChange(isConnected) {
|
||||
* console.log('Then, is ' + (isConnected ? 'online' : 'offline'));
|
||||
* NetInfo.isConnected.removeEventListener(
|
||||
* 'change',
|
||||
* 'connectionChange',
|
||||
* handleFirstConnectivityChange
|
||||
* );
|
||||
* }
|
||||
* NetInfo.isConnected.addEventListener(
|
||||
* 'change',
|
||||
* 'connectionChange',
|
||||
* handleFirstConnectivityChange
|
||||
* );
|
||||
* ```
|
||||
|
Loading…
x
Reference in New Issue
Block a user