use-localstorage-hook

1.0.1 • Public • Published

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

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.129latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.129
1.0.00

Package Sidebar

Install

npm i use-localstorage-hook

Weekly Downloads

23

Version

1.0.1

License

MIT

Unpacked Size

11.2 kB

Total Files

7

Last publish

Collaborators

  • filipdanic