useSessionStorage ​
Hook that manages session storage value
state
medium
test coverage
Last changed: 3 months ago
Installation ​
Library
CLI
Manual
typescript
import { useSessionStorage } from '@siberiacancode/reactuse';Usage ​
typescript
const { value, set, remove } = useSessionStorage('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 |
Type declaration ​
typescript
import type { UseStorageInitialValue, UseStorageOptions } from '../useStorage/useStorage';Source ​
Source • DemoContributors ​
D
H