Skip to content

Latest commit

 

History

History
28 lines (17 loc) · 492 Bytes

useOnlineStatus.md

File metadata and controls

28 lines (17 loc) · 492 Bytes

useOnlineStatus

A hook to detect the online/offline status of the browser.

Arguments

  • None

Returns

  • A boolean indicating if the browser is online.

Hooks Involved

How to Use

import useOnlineStatus from "./useOnlineStatus"

export default function OnlineStatusComponent() {
    const online = useOnlineStatus()

    return <div>{online.toString()}</div>
}