useOnlineStatus
Whether the browser reports a network connection.
Follows the online and offline events. False is reliable: queue work and say so. True only means 'maybe' (a captive portal reports online), so request errors stay the source of truth.
Usage
Examples
Offline notice
API
1 return value
Accessibility
Show offline state as text (an Alert or a status region), not only as a colour, and keep entered work.
Notes
- Do not block reading content offline; disable only the actions that need the network.
Related
useDocumentTitleSet a document title and restore the previous owner on cleanup.useIsClientFalse on the server and during hydration, true on the client.useIsMobileTrue below the 768px phone breakpoint.useIsMountedA stable getter for whether this hook is currently mounted.useMediaQueryTrack a CSS media query, SSR-safe.usePageVisibilityWhether the tab is visible, to pause work in the background.