Skip to content

Commit dbb1dc8

Browse files
author
Karol
committed
useStorage: fix for default value from a function
1 parent 6c538c0 commit dbb1dc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/8-useStorage/useStorage.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function useStorage(key, defaultValue, storageObject) {
1313
const jsonValue = storageObject.getItem(key)
1414
if (jsonValue != null) return JSON.parse(jsonValue)
1515

16-
if (typeof initialValue === "function") {
16+
if (typeof defaultValue === "function") {
1717
return defaultValue()
1818
} else {
1919
return defaultValue

0 commit comments

Comments
 (0)