https://github.com/ericrabil/react-use-persistent
https://github.com/ericrabil/react-use-persistent
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ericrabil/react-use-persistent
- Owner: EricRabil
- Created: 2021-04-12T16:12:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-12T16:12:53.000Z (about 5 years ago)
- Last Synced: 2025-07-01T09:48:22.908Z (12 months ago)
- Language: TypeScript
- Size: 209 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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)