Skip to content

useOnline ​

sensors
test coverage
Last changed: 28 days 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

Hook that manages if the user is online

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

Usage ​

typescript
const online = useOnline();

Demo ​

Api ​

Returns

boolean

Source ​

Source • Demo

Contributors ​

Avatardebabin
Avatarhywax

Released under the MIT License.