This package has been deprecated

Author message:

This package is no longer being maintained. This hook will be included in the the @24/react-hooks package.

use-localstorage-react

1.0.4 • Public • Published

use-localstorage-react

A custom hook to save state to localstorage!

Demo

Sandbox 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.

Package Sidebar

Install

npm i use-localstorage-react

Weekly Downloads

1

Version

1.0.4

License

MIT

Unpacked Size

3.36 kB

Total Files

6

Last publish

Collaborators

  • marcusthelin