react-is-online
v0.0.4
Published
react higher order component to detect the network goes to offline or not.
Downloads
6
Maintainers
Readme
react-is-online
Higher order component to detect the network goes to offline or not.
Install
$ npm i react-is-onlineUsage
import IsOnline from 'react-is-online'
const IsOnlineComponent = IsOnline(({ ...props }) => {
return (
<a
href="#"
onClick={ props.reconnect }
className={ props.isOnline ? '...' : '...' }
>
</a>
)
})
<IsOnlineComponent />Props
| props | type | description |
| ----- | ----- | ------- |
| isOnline | Boolean | Boolean value the network is online or not. |
| reconnect | Function | Method trying to connect to the network. |
| isMonitoring | Boolean | Monitoring the network connection status. |
| isReconnecting | Boolean | Reconnecting. |
License
MIT
