diff --git a/packages/web-util/src/hooks/useLocalStorage.ts b/packages/web-util/src/hooks/useLocalStorage.ts index fae5537a4..b460144a6 100644 --- a/packages/web-util/src/hooks/useLocalStorage.ts +++ b/packages/web-util/src/hooks/useLocalStorage.ts @@ -106,7 +106,7 @@ export function useLocalStorage( const newValue = storage.get(key.id); setStoredValue(convert(newValue)); }); - }, []); + }, [key.id]); const setValue = (value?: Type): void => { if (value === undefined) { diff --git a/packages/web-util/src/hooks/useMemoryStorage.ts b/packages/web-util/src/hooks/useMemoryStorage.ts index 1dd263797..ef186392f 100644 --- a/packages/web-util/src/hooks/useMemoryStorage.ts +++ b/packages/web-util/src/hooks/useMemoryStorage.ts @@ -51,7 +51,7 @@ export function useMemoryStorage( const newValue = storage.get(key); setStoredValue(newValue === undefined ? defaultValue : newValue); }); - }, []); + }, [key]); const setValue = (value?: Type): void => { if (value === undefined) {