@ayltai/use-online-status
v1.0.9
Published
A React hook to observe online status
Downloads
10
Readme
React Hook: use-online-status
A React hook to observe online status.
Installation
npm install @ayltai/use-online-status
Usage
import { useOnlineStatus, } from '@ayltai/use-online-status';
const Example = () => {
const isOnline = useOnlineStatus();
return (
<>
{`You are ${isOnline ? 'online' : 'offline'}`}
</>
);
};