Skip to content

taystack/use-storage

Repository files navigation

@taystack/use-storage

Strong types for local storage access using react hooks.

NPM JavaScript Style Guide

Install

npm install --save @taystack/use-storage

Usage

Similar to React.useState. All use*Storage methods apply

import { useLocalStorageString } from '@taystack/use-storage'

function MyComponent() {
  const [value, setValue] = useLocalStorageString('my_store_key', 'default value')
  return (
    <div>My stored value {value}</div>
  )
}

License

MIT © taystack


This hook is created using create-react-hook.

About

Strong types for session or local storage access using react hooks.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published