useOffline 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>; }