INNER CODE UNIT · TypeScript
useNetInfoInstance
react-native-netinfo/react-native-netinfo · src/index.ts:162
export function useNetInfoInstance(
isPaused = false,
configuration?: Partial<Types.NetInfoConfiguration>,
) {
const [networkInfoManager, setNetworkInfoManager] = useState<State>();
const [netInfo, setNetInfo] = useState<Types.NetInfoState>({
type: Types.NetInfoStateType.unknown,
isConnected: null,
isInternetReachable: null,
details: null,
});
useEffect(() => {
if (isPaused) {
return;
}
const config = {
...DEFAULT_CONFIGURATION,