0.0.4 • Published 7 years ago
react-is-online v0.0.4
react-is-online
Higher order component to detect the network goes to offline or not.
Install
$ npm i react-is-online
Usage
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