use-offline
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

useOffline

CI/CD version downloads

Listen to network connectivity events with a React hook.

Install

  • npm install use-offline or
  • yarn add use-offline

Use

import useOffline from 'use-offline';

export default function App() {
  const isOffline = useOffline();

  return <p>You are {isOffline ? 'offline' : 'online'}.</p>;
}

Readme

Keywords

none

Package Sidebar

Install

npm i use-offline

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

7.18 kB

Total Files

12

Last publish

Collaborators

  • charlesstover