From 8b3bf174ec6f38d037df181b64b5b8022dca1bd3 Mon Sep 17 00:00:00 2001 From: Srinivasan M Date: Thu, 1 Feb 2024 11:38:48 +0530 Subject: [PATCH] [@mantine/hooks] use-session-storage: Fix default value not being set in the storage on initial render (#5663) --- packages/@mantine/hooks/src/use-local-storage/create-storage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@mantine/hooks/src/use-local-storage/create-storage.ts b/packages/@mantine/hooks/src/use-local-storage/create-storage.ts index a12dd8be5d8..235511cb413 100644 --- a/packages/@mantine/hooks/src/use-local-storage/create-storage.ts +++ b/packages/@mantine/hooks/src/use-local-storage/create-storage.ts @@ -150,7 +150,7 @@ export function createStorage(type: StorageType, hookName: string) { useEffect(() => { if (getInitialValueInEffect) { - setValue(readStorageValue()); + setStorageValue(readStorageValue()); } }, []);