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

https://github.com/navneetlal/react-offline-component

Checks net connection and renders component accordingly
https://github.com/navneetlal/react-offline-component

connection detector network offline online react react-component

Last synced: 7 days ago
JSON representation

Checks net connection and renders component accordingly

Awesome Lists containing this project

README

        



GitHub license


GitHub issues

GitHub release (latest SemVer)

npm

npm bundle size

# React offline component

Simple react component that enables you to render content based on net connectivity (i.e. Online | Offline)

### Installing

```bash
$ npm install react-offline-component --save
```

### Basic usage

```jsx
import React from 'react';
import ReactDOM from 'react-dom';
import { Online, Offline } from 'react-offline-component';

const MainComponent = () => {
return (

Hey! You are online
You're offline. Check your connection!

)
}

ReactDOM.render(, document.getElementById('root'));
```

Both `Online` as well as `Offline` are conditional components. So, you won't be seeing any online or offline component unless you are in that state.

### License
Published under the [MIT License](https://github.com/navneetlal/react-offline-component/blob/master/LICENSE).