Hooks

useOnline

Publisher

cermuel

50 hooks published

More from this publisher

useOnline

Track whether the user currently has a network connection.

useOnline.tsx
import { useOnline } from "@cermuel/hooks/react";export function UseOnlineExample() {  const online = useOnline();  return <p>You are currently {online ? "online" : "offline"}.</p>;}

Props

Param
Type
Default Value

No props for this hook

Returns

boolean