Skip to content

Commit

Permalink
fix: add check before accessing a value
Browse files Browse the repository at this point in the history
  • Loading branch information
getusha committed Feb 20, 2024
1 parent e485645 commit 0ed1fe9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __mocks__/@react-native-community/netinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import {NetInfoCellularGeneration, NetInfoStateType} from '@react-native-communi
import type {addEventListener, configure, fetch, NetInfoState, refresh, useNetInfo} from '@react-native-community/netinfo';

const defaultState: NetInfoState = {
type: NetInfoStateType.cellular,
type: NetInfoStateType?.cellular,
isConnected: true,
isInternetReachable: true,
details: {
isConnectionExpensive: true,
cellularGeneration: NetInfoCellularGeneration['3g'],
cellularGeneration: NetInfoCellularGeneration ? NetInfoCellularGeneration['3g'] : null,
carrier: 'T-Mobile',
},
};
Expand Down

0 comments on commit 0ed1fe9

Please sign in to comment.