Skip to content
Function

useSessionStorage

State scoped to a single browser tab session.

See useSessionStorage with a live demo

@danixsoft/hooks


useSessionStorage<T>(key, initialValue): readonly [T, (value) => void]

Type Parameters

T

T

Parameters

key

string

initialValue

T

Returns

readonly [T, (value) => void]