1.0.4 • Published 5 years ago
use-localstorage-react v1.0.4
use-localstorage-react
A custom hook to save state to localstorage!
Demo
Usage
Import it
import useLocalStorage from 'use-localstorage-react'
Set key and initial value
const [count, setCount] = useLocalStorage(0, 'counter')
Reload to see that the value stays the same.