Constructor
# new useLocalStorage(key, initialValue) → {UseLocalStorageResult.<T>}
Parameters:
Name | Type | Description |
---|---|---|
key |
string
|
key under which hook will store the data |
initialValue |
T
|
value which will be stringified and stored |
Type Definitions
Array
# UseLocalStorageResult
Result of the useLocalStorage.
It is a tuple containing value and the setter
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
0 |
T
|
<optional> |
the value stored in the local store |
1 |
React.Dispatch.<React.SetStateAction.<T>>
|
<optional> |
value setter compatible with react useState |