1.0.1 • Published 4 years ago
@hoooks/use-network v1.0.1
@hoooks/use-network
Check whether the network status is online or offline.
Installation
yarn
yarn add @hoooks/use-network
npm
npm i @hoooks/use-network
Usage
import React from "react";
import useTitle from "@hoooks/use-network";
export default function App() {
const isOnline = useNetwork();
return (
<>
<h1>{isOnline ? "Online" : "Offline"}</h1>
</>
);
}
Return
Return | Type | Description |
---|---|---|
Boolean | Boolean | A boolean indicating the network status |