- Detect network connection instantly
- Highly customizable UI
$ npm install react-native-network-notifier --save
or
$ yarn add react-native-network-notifier
import React from 'react';
import NetworkNotifier from 'react-native-network-notifier';
export default class App extends React.PureComponent {
render() {
return (
<NetworkNotifier />
);
}
}
| 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 |
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