Skip to content

Commit abd7f86

Browse files
committed
fix: useLocalStorage dependency array
1 parent 627560f commit abd7f86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/devtools/useLocalStorage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function useLocalStorage(key, defaultValue) {
2323
} else {
2424
setValue(initialValue)
2525
}
26-
}, [])
26+
}, [defaultValue, key])
2727

2828
const setter = React.useCallback(
2929
updater => {

0 commit comments

Comments
 (0)