@rnhooks/network-status

0.0.1 • Public • Published

@rnhooks/network-status Build Status Maintainability module formats: umd, cjs, esm

React Native hook for Network Status

Installation

$ yarn add @rnhooks/network-status

Usage

import useNetworkStatus from '@rnhooks/network-status';

function App() {
  const { type, effectiveType } = useNetworkStatus();

  return (
    <View style={styles.container}>
      <Text style={styles.type}>{`Type: ${type}`}</Text>
      <Text style={styles.effectiveType}>{`Effective Type: ${effectiveType}`}</Text>
    </View>
  );
}

Output

Prop Default Type Description
type null none / wifi / cellular / unknown Describes the type of connection the device is using to communicate with the network
effectiveType null 2g / 3g / 4g / unknown Cross platform values for EffectiveConnectionType

Package Sidebar

Install

npm i @rnhooks/network-status

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

21.6 kB

Total Files

11

Last publish

Collaborators

  • divyanshu013
  • pritishvaidya