Skip to content

Latest commit

 

History

History
50 lines (36 loc) · 1.64 KB

File metadata and controls

50 lines (36 loc) · 1.64 KB

react-native-network-notifier

Features

  • Detect network connection instantly
  • Highly customizable UI

Demo

Demo

Getting started

$ npm install react-native-network-notifier --save

or

$ yarn add react-native-network-notifier

Usage

import React from 'react';
import NetworkNotifier from 'react-native-network-notifier';

export default class App extends React.PureComponent {
  render() {
    return (
      <NetworkNotifier />
    );
  }
}

Props

| Props                | type              | usage                                                  | default       |
| position             | enum [top, right] | specify position of component                          | top           |
| showOnline           | boolean           | notify user when status changes from offline to online | true          |
| offlineText          | string            | text to be shown for offline state                     | No Connection |
| offlineComponent     | React Component   | your custom component for offline state                |               | 
| onlineText           | string            | text to be shown for online state                      | Back Online   |
| onlineComponent      | React Component   | your custome component for online state                |               |
| onlineTimeoutSeconds | number            | timeout seconds before online component dissappears    | 3000          |

Note

Whenever you specify your custom component, position props will no longer be useful, hence, you will need to specify the absolute position in your style

Created for the love of react-native