diff --git a/packages/web-util/src/hooks/useLocalStorage.ts b/packages/web-util/src/hooks/useLocalStorage.ts index 25df9dfcd..f518405b6 100644 --- a/packages/web-util/src/hooks/useLocalStorage.ts +++ b/packages/web-util/src/hooks/useLocalStorage.ts @@ -85,9 +85,9 @@ export function useNotNullLocalStorage( const listener = buildListenerForKey(key, (newValue) => { setStoredValue(newValue ?? initialValue) }) - window.localStorage.addEventListener('storage', listener) + window.addEventListener('storage', listener) return () => { - window.localStorage.removeEventListener('storage', listener) + window.removeEventListener('storage', listener) } })