# react-localforage

> Declarative localForage in React

Latest version **1.0.1** (published 2017-08-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-localforage
pnpm add react-localforage
yarn add react-localforage
bun add react-localforage
```

## 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.1 |
| Published | 2017-08-18 |
| First published | 2017-08-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 52 |
| Author | Kye Hohenberger |
| Maintainers | tkh44 |
| Keywords | react-component, react, localforage, localForage, local, storage, react-localforage |

## Links

- npm: https://www.npmjs.com/package/react-localforage
- Repository: https://github.com/tkh44/react-localforage
- Homepage: https://github.com/tkh44/react-localforage#readme
- Issues: https://github.com/tkh44/react-localforage/issues
- npm.io page: https://npm.io/package/react-localforage

## Dependencies (1)

- [localforage](https://npm.io/package/localforage.md) ^1.5.0

## 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.1 (latest) — 2017-08-18

## README

# react-localforage
Declarative [localForage](https://github.com/localForage/localForage) in React

[![npm version](https://badge.fury.io/js/react-localforage.svg)](https://badge.fury.io/js/react-localforage)
[![Build Status](https://travis-ci.org/tkh44/react-localforage.svg?branch=master)](https://travis-ci.org/tkh44/react-localforage)
[![codecov](https://codecov.io/gh/tkh44/react-localforage/branch/master/graph/badge.svg)](https://codecov.io/gh/tkh44/react-localforage)

-   [Install](#install)
-   [API](#api)
  -   [Forage.GetItem](#forage-getitem)
  -   [Forage.SetItem](#forage-setitem)

## Install

```bash
npm install -S react-localforage
```

```javascript
import Forage from 'react-localforage'
```

## API

### `Forage.GetItem`

```jsx
<Forage.GetItem
  key='auth-token'
  render={({inProgress, value, error}) => {
    return (
      <div>
        {error &&
        <div>
          {error.message}
        </div>}
        {inProgress && <progress/>}
        {value &&
         <pre>{JSON.stringify(value, null, 2)}</pre>}
      </div>
    )
  }}
/>
```

### `Forage.SetItem`

```jsx
<Forage.SetItem
  itemKey='auth-token'
  itemValue={authToken}
  render={({inProgress, value, error}) => {
    return (
      <div>
        {error &&
        <div>
          {error.message}
        </div>}
        {inProgress && <progress/>}
        {value &&
        <div>
          {value}
        </div>}
      </div>
    )
  }}
/>
```

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