useSessionStorage
Manages a state variable synchronized with session storage.
useSessionStorage
Installation
Usage
API
useSessionStorage
Parameters
| Name | Type | Description | 
|---|---|---|
| key | string | The key of the item to be stored in session storage. | 
| initialValue | T | The initial value to be used if the item does not exist in session storage. | 
Returns
| Name | Type | Description | 
|---|---|---|
| value | T | The value of the item in session storage. | 
| setValue | (value: T) => void | A function that sets the value of the item in session storage. |