react-is-online

0.0.4 • Public • Published

react-is-online

npm version travis License

Higher order component to detect the network goes to offline or not.

Demo

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

/react-is-online/

    Package Sidebar

    Install

    npm i react-is-online

    Weekly Downloads

    1

    Version

    0.0.4

    License

    MIT

    Last publish

    Collaborators

    • makotot