useLocalStorage ​
Hook that manages local storage value
typescript
import { useLocalStorage } from '@siberiacancode/reactuse';
Usage ​
typescript
const { value, set, remove } = useLocalStorage('key', 'value');
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
key | string | - | The key of the storage |
initialValue? | UseStorageInitialValue<Value> | - | The initial value of the storage |
options? | UseStorageOptions<Value> | - | The options of the storage |