Skip to content

ritwickdey/online-status

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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>
  );
}

About

React Hook for Online status

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%