1.0.1 • Published 4 years ago

@hoooks/use-network v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@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

ReturnTypeDescription
BooleanBooleanA boolean indicating the network status