diff options
Diffstat (limited to 'packages/web-util/src/hooks')
-rw-r--r-- | packages/web-util/src/hooks/useLocalStorage.ts | 2 | ||||
-rw-r--r-- | packages/web-util/src/hooks/useMemoryStorage.ts | 2 |
2 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 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<Type = string>( 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<Type = string>( const newValue = storage.get(key); setStoredValue(newValue === undefined ? defaultValue : newValue); }); - }, []); + }, [key]); const setValue = (value?: Type): void => { if (value === undefined) { |