fix: wrong listener place
This commit is contained in:
parent
eb2e04aaf8
commit
1665cf4f72
@ -85,9 +85,9 @@ export function useNotNullLocalStorage(
|
|||||||
const listener = buildListenerForKey(key, (newValue) => {
|
const listener = buildListenerForKey(key, (newValue) => {
|
||||||
setStoredValue(newValue ?? initialValue)
|
setStoredValue(newValue ?? initialValue)
|
||||||
})
|
})
|
||||||
window.localStorage.addEventListener('storage', listener)
|
window.addEventListener('storage', listener)
|
||||||
return () => {
|
return () => {
|
||||||
window.localStorage.removeEventListener('storage', listener)
|
window.removeEventListener('storage', listener)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user