react-native APIs
- View
- Text
- StyleSheet
- TouchableOpacity
- Image
- ScrollView
- Dimensions
- Platform
- TextInput
- FlatList
- StatusBar
- SafeAreaView
- Alert
- AppRegistry
- Animated
- ActivityIndicator
- KeyboardAvoidingView
- Button
- Linking
- Modal
- TouchableWithoutFeedback
- ImageBackground
- Keyboard
- TouchableHighlight
- NativeModules
- Easing
- BackHandler
- RefreshControl
- AsyncStorage
- ToastAndroid
- PanResponder
- AppState
- Switch
- PermissionsAndroid
- ViewPropTypes
- YellowBox
- TouchableNativeFeedback
- LayoutAnimation
- PixelRatio
- Share
- Vibration
- InteractionManager
- Picker
- LogBox
- SectionList
- I18nManager
- Pressable
- NativeEventEmitter
- UIManager
- DeviceEventEmitter
- findNodeHandle
- Clipboard
- Appearance
- useColorScheme
- Slider
- ActionSheetIOS
- useWindowDimensions
- CameraRoll
- requireNativeComponent
- PushNotificationIOS
- unstable_batchedUpdates
- VirtualizedList
- NetInfo
- Networking
- TVEventHandler
- processColor
- console
- TextPropTypes
- TouchableWithoutFeedbackProps
- TurboModuleRegistry
OtherRelated APIs
react-native#NetInfo JavaScript Examples
The following examples show how to use
react-native#NetInfo.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: NetworkReachability.js From RRWallet with MIT License | 6 votes |
export default async function checkNetworkReachability(url = network.pingURL) {
try {
return false;
let connectionChecked;
if (Platform.OS === "ios") {
const { type, effectiveType } = await NetInfo.getConnectionInfo();
connectionChecked = type !== "none";
} else {
connectionChecked = await NetInfo.isConnected.fetch();
}
const isConnected = connectionChecked;
return isConnected;
return true;
} catch (error) {
return true;
}
}