Thanks to visit codestin.com
Credit goes to github.com

Skip to content

nbnsresta/use-localstorage-sync

Repository files navigation

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.

About

React hooks api to synchronize localstorage as a state

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published