New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-network-checker

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-network-checker

A simple and customizable React Native component that checks internet connection and shows message about the connection.

latest
Source
npmnpm
Version
0.1.5
Version published
Maintainers
1
Created
Source

react-native version npm version npm downloads

react-native-network-checker Bhargava Prabu Reddy M

Quick start

Installation

npm install --save react-native-network-checker

React Native Network Checker uses @react-native-community/netinfo as a main dependency.

Important - Dont forget this step

This packages uses @react-native-community/netinfo as a dependency.

  • Install @react-native-community/netinfo and follow the instructions to install and link react-native-netinfo.

That's it. you're ready to go.

Basic Usage

import React from 'react';
import {
  StyleSheet,
  View,
  Text,
} from 'react-native';
import NetworkChecker from 'react-native-network-checker';

const App = () => {
  return (
    <NetworkChecker
      position="bottom"
      duration={2000} // In milliseconds
      notConnectedMessage="Not connected to Internet!"
      notConnectedTextColor="white"
      notConnectedBackgroundColor="grey"
      connectedMessage="Connected to Internet!"
      connectedTextColor="white"
      connectedBackgroundColor="green"
    >
      <View style={styles.screen}>
        <Text>React Native Network Checker</Text>
      </View>
    </NetworkChecker>
  );
};

const styles = StyleSheet.create({
  screen: {
    flex: 1,
    justifyContent: 'center',
    alignItems: 'center',
  },
});

export default App;

Props

PropTypeDescriptionDefault
positionstringtop or bottom, Component to displaybottom
durationnumberMilliseconds to display connected to Internet text5000
styleobjectStyle object{}
connectedMessagestringMessage to show when connected to internetBack Online
connectedTextColorstringColor of text when connected to internetwhite
connectedBackgroundColorstringBackgroundcolor of container when connected to internetgreen
notConnectedMessagestringMessage to show when not connected to internetNo Connection
notConnectedTextColorstringColor of text when not connected to internetwhite
notConnectedBackgroundColorstringBackgroundcolor of container when not connected to internetgrey

Contribution

Contribution are welcome!. Please see the contributing guide

Questions

Feel free to Contact me or Create an issue

License

Released under the Mit License

Keywords

react-native

FAQs

Package last updated on 01 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts