Skip to content

useOnline

Hook that manages if the user is online

browser
medium
test coverage
Last changed: 7 months ago

TIP

This hook uses navigator.onLine browser api to provide enhanced functionality. Make sure to check for compatibility with different browsers when using this api

Installation

Library
CLI
Manual
typescript
import { useOnline } from '@siberiacancode/reactuse';

Usage

typescript
const online = useOnline();

Demo

Api

Returns

boolean

Source

SourceDemo

Contributors

D
debabin
debabin
H
hywax
hywax

Released under the MIT License.