Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/emanueljcc/react-detect-internet-connection

Library to detect the state of the internet connection in an application with react.js in a dynamic way.
https://github.com/emanueljcc/react-detect-internet-connection

connection css3 hook hooks html internet library navigator-api network react

Last synced: 24 days ago
JSON representation

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

Awesome Lists containing this project

README

        


React detect internet connection (custom hook) 📶







View Demo

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

## Install

```bash
npm install react-detect-internet-connection
```
OR
```bash
yarn add react-detect-internet-connection
```

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

```javascript
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 (

Content...


);
}
```

## Documentation

```javascript
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](https://choosealicense.com/licenses/mit/) License © 2022 [Emanuel Castillo](https://github.com/emanueljcc)