useSessionStorage
Callable
Type parameters
- T
Parameters
key: string
The key to use for the
sessionStorage.initialValue: ExcludeFunction<T>
The initial value to use for the
sessionStorage.optionaloptions: any
Optional options to configure the behavior of the hook.
Returns readonly [unknown, { resetStorage: () => void; setStorage: (value: unknown) => void }]
Returns a hook that provides a
sessionStoragevalue for a given key.