You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A simple react hook that allows you to store data within `LocalStorage` with same interface as the standard `React.useState` hook.
8
8
9
9
## Introduction
10
10
11
-
Package introduction, couple of paragraphs.
11
+
Just swap out your `useState` calls with `useLocalState` to persist the data between refreshes. This hook is also SSR safe and does not break when used without `window` existing.
-`argument1` : Required - Description of argument.
79
-
-`argument2` : Optional - Description of argument.
87
+
- `key` : Required - The key to store within `LocalStorage`.
88
+
- `initialValue` : Required - The default/initial value if the key is not found within the `LocalStorage` object.
80
89
81
90
### Output
82
91
83
-
-`something`: Description of output.
92
+
An array containing the value and a function to set the value. Signiature is exactly like the standard [React.useState](https://reactjs.org/docs/hooks-state.html) hook.
0 commit comments