useOnline
Aboutβ
Online status hook for React.
Installationβ
npm install --save rooks
Importing the hookβ
import { useOnline } from 'rooks';
Usageβ
function Demo() {
const isOnline = useOnline();
return <p>Online status - {isOnline.toString()}</p>;
}
render(<Demo />);
Return valueβ
Offline status (boolean) is returned.
Codesandbox Exampleβ
Basic usageβ
Join Bhargav's discord serverβ
You can click on the floating discord icon at the bottom right of the screen and talk to us in our server.