npm

@phenomenon-hooks/use-local-storage
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

useLocalStorage


Installation

yarn add @phenomenon-hooks/use-local-storage

or

npm i @phenomenon-hooks/use-local-storage

Usage

import React from 'react';
import { useLocalStorage } from '@phenomenon-hooks/use-local-storage';

const Component: React.FC = () => {
    const [value, setValue] = useLocalStorage('key', 'value');

    return (
        <div>
            <p>Value: {value}</p>
            <button
                onClick={() => {
                    setValue('new value');
                }}
            >
                Set new value
            </button>
        </div>
    );
};

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.21latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.21
0.0.10

Package Sidebar

Install

npm i @phenomenon-hooks/use-local-storage

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

10.5 kB

Total Files

8

Last publish

Collaborators

  • mykola.kolomoyets