We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6c538c0 commit dbb1dc8Copy full SHA for dbb1dc8
src/8-useStorage/useStorage.js
@@ -13,7 +13,7 @@ function useStorage(key, defaultValue, storageObject) {
13
const jsonValue = storageObject.getItem(key)
14
if (jsonValue != null) return JSON.parse(jsonValue)
15
16
- if (typeof initialValue === "function") {
+ if (typeof defaultValue === "function") {
17
return defaultValue()
18
} else {
19
return defaultValue
0 commit comments