Skip to content

Commit

Permalink
Update connection type event in README (#66)
Browse files Browse the repository at this point in the history
Starting React-Native v0.48.4 the NetInfo's "change" event is deprecated
The new event type is 'connectionChange'
  • Loading branch information
maieonbrix authored and Raúl Gómez Acuña committed Dec 28, 2017
1 parent f225730 commit 71d96fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,13 +414,13 @@ function isNetworkConnected(): Promise<boolean> {
return new Promise(resolve => {
const handleFirstConnectivityChangeIOS = isConnected => {
NetInfo.isConnected.removeEventListener( // Cleaning up after initial detection
'change',
'connectionChange',
handleFirstConnectivityChangeIOS,
);
resolve(isConnected);
};
NetInfo.isConnected.addEventListener(
'change',
'connectionChange',
handleFirstConnectivityChangeIOS,
);
});
Expand Down

0 comments on commit 71d96fc

Please sign in to comment.