1.0.1 • Published 5 years ago

use-localstorage-hook v1.0.1

Weekly downloads
25
License
MIT
Repository
github
Last release
5 years ago

NPM

use-localstorage-hook

A custom React hook that lets you sync with localStorage and helps you manipulate objects via built-in JSON.stringify helpers.

👉 Demo site and docs.

Quick Start

Start with:

npm install --save use-localstorage-hook

And in your component use the hook like this:

[ val, setVal ] = useLocalStorage(
  'demo',
  { a: 'Hello!' }
);
console.log(val.a)
// => "Hello!"

Docs

The complete documentation as well as a live demo is available here.

License

MIT © filipdanic