react-native-net-state

1.1.2 • Public • Published

react-native-net-state

Setting

  • Android:
To request network info, you need to add the following line to your app's
AndroidManifest.xml:
 
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
Asynchronously determine if the device is connected and details about that connection.

Example

import React, {Component, PropTypes} from 'react';
import NetState from 'react-native-net-state';
 
class Run extends Component {
  render() {
    return (
      <View style={{flex: 1}}>
        <NetState message="No internet access"/>
      </View>
    );
  }
});
 
module.exports = Run;

Installation

npm install react-native-net-state --save

Props

  • message you can customize message
  • style you can customize styles box
  • styleText you can customize styles message

Package Sidebar

Install

npm i react-native-net-state

Weekly Downloads

2

Version

1.1.2

License

ISC

Last publish

Collaborators

  • tienlm1509