Import this in your client-side component
MyComponent.tsx
import { useOnlineStatus } from "react-amazing-hooks";
API
Api | Description | Type | Return Type | Example |
---|---|---|---|---|
useOnlineStatus | A hook to detect the online status of the user. | void | boolean | const isOnline = useOnlineStatus(); |
Check the 'Example' tab above the table for an exhaustive example. *