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

https://github.com/ericrabil/react-use-persistent


https://github.com/ericrabil/react-use-persistent

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

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 (
setSetting(event.target.checked)} />
)
}
```

## License

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