1.1.2 • Published 5 years ago

@rehooks/online-status v1.1.2

Weekly downloads
2,632
License
MIT
Repository
github
Last release
5 years ago

@rehooks/online-status

React hook for subscribing to online/offline events and the navigator.onLine property to see current status

You'll need to install react, react-dom, etc at ^16.8.4

Install

yarn add @rehooks/online-status

Usage

import useOnlineStatus from '@rehooks/online-status';

function MyComponent() {
  const onlineStatus = useOnlineStatus();
  return (
    <div>
      <h1>You are {onlineStatus ? "Online" : "Offline"}</h1>
    </div>
  );
}
1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

6 years ago