react-detect-internet-connection
v1.0.0
Published
Library to detect the state of the internet connection in an application with react.js in a dynamic way.
Downloads
8
Readme
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
[email protected]. 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