use-localstorage-sync
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

React Localstorage Sync

React hooks api to synchronize localstorage as a state across browser tabs

Start with

  yarn add use-localstorage-sync

and can be used as a state hook in any React component

+ import useLocalStorage from "use-localstorage-sync";

+ const [value, setValue] = useLocalStorage("key");

Similar to the useState hook, the value in the associated key is updated in localstorage, it is updated. Similarly, the setValue updates the state in all associated browser tabs simulataneously.

/use-localstorage-sync/

    Package Sidebar

    Install

    npm i use-localstorage-sync

    Weekly Downloads

    97

    Version

    0.1.3

    License

    MIT

    Unpacked Size

    29 kB

    Total Files

    19

    Last publish

    Collaborators

    • nbnsresta