# react-no-sleep

> headless component to keep browser awake

Latest version **1.0.2** (published 2018-09-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-no-sleep
pnpm add react-no-sleep
yarn add react-no-sleep
bun add react-no-sleep
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2018-09-02 |
| First published | 2018-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8 |
| Dependencies | 1 |
| Unpacked size | 64.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | malcolm-kee |
| Maintainers | malcolmkee |

## Links

- npm: https://www.npmjs.com/package/react-no-sleep
- Repository: https://github.com/malcolm-kee/react-no-sleep
- Homepage: https://github.com/malcolm-kee/react-no-sleep#readme
- Issues: https://github.com/malcolm-kee/react-no-sleep/issues
- npm.io page: https://npm.io/package/react-no-sleep

## Dependencies (1)

- [nosleep.js](https://npm.io/package/nosleep.js.md) ^0.7.0

## Recent versions

- 1.0.2 (latest) — 2018-09-02
- 1.0.1 — 2018-09-02
- 1.0.0 — 2018-09-02

## README

# react-no-sleep

> headless component to keep browser awake

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

## Install

```bash
npm install --save react-no-sleep
```

## Usage

```tsx
import * as React from 'react';

import ReactNoSleep from 'react-no-sleep';

class Example extends React.Component {
  render() {
    return (
      <ReactNoSleep>
        {({ isOn, enable, disable }) => (
          <button onClick={isOn ? disable : enable}>
            {isOn ? 'on' : 'off'}
          </button>
        )}
      </ReactNoSleep>
    );
  }
}
```

## License

MIT © [malcolm-kee](https://github.com/malcolm-kee)

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