diff options
-rw-r--r-- | packages/web-util/src/hooks/useLocalStorage.ts | 4 |
1 files changed, 2 insertions, 2 deletions
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) } }) |