解析 @react-native-community

1,851 阅读1分钟

netinfo

获得Network Connection type、Network Connection quality

NetInfoState

  • type :NetInfoStateType
  • isConnected:boolean, null
  • isInternetReachable:boolean, null
  • isWifiEnabled: boolean, (Android only)
  • details:The value depends on the type value.

NetInfoStateType

NetInfoCellularGeneration

描述 蜂窝网络 ,值 有:null、2g、3g、4g、5g

configure()

使用给定配置配置库。您只需提供要从默认值更改的属性。

请注意,调用此将停止再次调用以前添加的 listeners。It is best to call this right when your application is started to avoid issues.

addEventListener()

订阅连接信息。每当连接状态更改时,通过NetInfostate类型的参数调用回调。

useNetInfo()

A React Hook which can be used to get access to the latest state. It returns a hook with the [NetInfoState](https://github.com/react-native-netinfo/react-native-netinfo/blob/HEAD/README.md#netinfostate) type.

fetch()

Returns a Promise that resolves to a [NetInfoState](https://github.com/react-native-netinfo/react-native-netinfo/blob/6b01fee211df160d0afce70c5955681c75b24a5a/README.md#netinfostate) object.

cameraroll

art

slider

progress-view

progress-bar-android

toolbar-android

eslint-plugin

cli-platform-android

cli-platform-ios

cli-tools

datetimepicker

image-picker-ios

eslint-config

hooks

clipboard

geolocation

push-notification-ios

react-native-translucent-modal

masked-view

cli-debugger-ui

cli-types

cli

cli-config

voice

cli-server-api

cli-doctor

async-storage-backend-web

segmented-control

cli-hermes

cookies

status-bar

cli-plugin-metro