Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 859 Bytes

README.md

File metadata and controls

34 lines (22 loc) · 859 Bytes

@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.