Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NetInfo.getConnectionInfo().then((connectionInfo) => {
- console.log('Initial, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
- });
- function handleFirstConnectivityChange(connectionInfo) {
- console.log('First change, type: ' + connectionInfo.type + ', effectiveType: ' + connectionInfo.effectiveType);
- NetInfo.removeEventListener(
- 'connectionChange',
- handleFirstConnectivityChange
- );
- }
- NetInfo.addEventListener(
- 'connectionChange',
- handleFirstConnectivityChange
- );
Add Comment
Please, Sign In to add comment