# react-use-persistent

> Persistent state made easy

Latest version **1.0.3** (published 2021-04-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-use-persistent
pnpm add react-use-persistent
yarn add react-use-persistent
bun add react-use-persistent
```

## 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.3 |
| Published | 2021-04-30 |
| First published | 2021-04-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 23.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | EricRabil |
| Maintainers | ericrabil |

## Links

- npm: https://www.npmjs.com/package/react-use-persistent
- Repository: https://github.com/EricRabil/react-use-persistent
- npm.io page: https://npm.io/package/react-use-persistent

## Recent versions

- 1.0.3 (latest) — 2021-04-30
- 1.0.2 — 2021-04-12
- 1.0.1 — 2021-04-12
- 1.0.0 — 2021-04-12

## README

# react-use-persistent

> Persistent state made easy

## Install

```bash
npm install --save react-use-persistent
```

## Usage

```tsx
import React, { Component } from 'react'

import { usePersistent } from 'react-use-persistent'

function MyComponent() {
  const [ setting, setSetting ] = usePersistent("localstorage-key", false);

  return (
    <input type="checkbox" checked={setting} onChange={event => setSetting(event.target.checked)} />
  )
}
```

## License

MIT © [EricRabil](https://github.com/EricRabil)

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