aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian <sebasjm@gmail.com>2023-08-30 10:17:23 -0300
committerSebastian <sebasjm@gmail.com>2023-08-30 11:52:44 -0300
commit84d4e68ab70c26ffcdccb5d62a507f9acf244fa3 (patch)
tree60495466e2e170f291c085d00466c44ec9a3de92
parentaba173d8a906fa0ede0c3660bd37b11fb7a6a127 (diff)
missing key subscription
-rw-r--r--packages/web-util/src/hooks/useLocalStorage.ts2
-rw-r--r--packages/web-util/src/hooks/useMemoryStorage.ts2
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) {