Skip to content
React Hook for Online status
Branch: master
Clone or download
Latest commit 389c994 May 3, 2019


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


yarn add @rehooks/online-status


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

function MyComponent() {
  const onlineStatus = useOnlineStatus();
  return (
      <h1>You are {onlineStatus ? "Online" : "Offline"}</h1>
You can’t perform that action at this time.