@ossan-engineer/use-online
v1.0.1
Published
This is a custom hook that subscribes the browser's connection status.
Downloads
4
Readme
use-online
React hook for subscribing the browser's connection status.
Install
yarn add use-online
Usage
import React from 'react';
import { useOnline } from 'use-online';
const Example = () => {
const isOnline = useOnline();
return <div>{isOnline ? 'ONLINE' : 'OFFLINE'}</div>;
};
License
MIT © ossan-engineer
This hook is created using create-react-hook.