# @ajay_g/react-netinfo

> A simple react hook to get network connectivity status

Latest version **1.0.2** (published 2020-10-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ajay_g/react-netinfo
pnpm add @ajay_g/react-netinfo
yarn add @ajay_g/react-netinfo
bun add @ajay_g/react-netinfo
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-10-27 |
| First published | 2020-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 0 |
| Unpacked size | 14.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ajay |
| Maintainers | ajay_g |
| Keywords | react, hooks, react-hooks, custom-hooks |

## Links

- npm: https://www.npmjs.com/package/@ajay_g/react-netinfo
- Repository: https://github.com/Ajayg96/react-netinfo
- Homepage: https://github.com/Ajayg96/react-netinfo#readme
- Issues: https://github.com/Ajayg96/react-netinfo/issues
- npm.io page: https://npm.io/package/@ajay_g/react-netinfo

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-10-27
- 1.0.1 — 2020-10-27
- 1.0.0 — 2020-10-27

## README

# React-Netinfo

> A simple react hook to get network connectivity status

[![NPM](https://img.shields.io/npm/v/@ajay_g/react-netinfo.svg)](https://www.npmjs.com/package/@ajay_g/react-netinfo) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save @ajay_g/react-netinfo
```

```bash
yarn add @ajay_g/react-netinfo
```

## Usage

```jsx
import React from "react";
import { useNetworkInfo } from "@ajay_g/react-netinfo";

const App = () => {
  const isOffline = useNetworkInfo();

  if (isOffline) {
    return <div>Sorry, you are offline :(</div>;
  }

  return <div>You are online :)</div>;
};
```

## License

MIT © [Ajay](LICENSE)

---

This hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).

---
_Source: https://npm.io/package/@ajay_g/react-netinfo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
