1.0.0 • Published 2 years ago

react-detect-internet-connection v1.0.0

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

Description

Library to detect the state of the internet connection in an application with react.js in a dynamic way.

Install

npm install react-detect-internet-connection

OR

yarn add react-detect-internet-connection

Usage

Add the react-detect-internet-connection to your main.js for a global import:

import React from 'react'

import useNetworkStatus from 'react-detect-internet-connection'

const App = () => {
  // PROPS
  const {
    isOnline,
    updateDate,
    rtt,
    type,
    saveData,
    downlink,
    downlinkMax,
    effectiveType,
  } = useNetworkStatus()

  return (
    <h1>Content...</h1>
  );
}

Documentation

const {
    isOnline,
    updateDate,
    rtt,
    type,
    saveData,
    downlink,
    downlinkMax,
    effectiveType,
  } = useNetworkStatus()

SIMPLE 😃

Support

emanuelcastillo9101@gmail.com. You can also send me a direct message on twitter @emanueljcc.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT License © 2022 Emanuel Castillo