From c3b026e06d236b2f7b832ec61356d0255fd6efbf Mon Sep 17 00:00:00 2001 From: Raymond - Toan Nguyen <6207857+toanxyz@users.noreply.github.com> Date: Thu, 27 Jun 2024 08:10:41 -0400 Subject: [PATCH] [mantine.dev] Add default value documentation for use-local-storage `getInitialValueInEffect` (#6388) * Update use-local-storage.mdx * Update use-local-storage.mdx * Update create-storage.ts --- apps/mantine.dev/src/pages/hooks/use-local-storage.mdx | 4 ++-- .../@mantine/hooks/src/use-local-storage/create-storage.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/mantine.dev/src/pages/hooks/use-local-storage.mdx b/apps/mantine.dev/src/pages/hooks/use-local-storage.mdx index b434941fb0a..2b0f8469ae0 100644 --- a/apps/mantine.dev/src/pages/hooks/use-local-storage.mdx +++ b/apps/mantine.dev/src/pages/hooks/use-local-storage.mdx @@ -141,8 +141,8 @@ interface UseLocalStorage { /** Default value that will be set if value is not found in local storage */ defaultValue?: T; - /** If set to true, value will be updated in useEffect after mount */ - getInitialValueInEffect: boolean; + /** If set to true, value will be updated in useEffect after mount. Default value is true. */ + getInitialValueInEffect?: boolean; /** Function to serialize value into a string to be saved in local storage */ serialize?: (value: T) => string; 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 b0a56deac22..0ffc53a388f 100644 --- a/packages/@mantine/hooks/src/use-local-storage/create-storage.ts +++ b/packages/@mantine/hooks/src/use-local-storage/create-storage.ts @@ -11,7 +11,7 @@ export interface StorageProperties { /** Default value that will be set if value is not found in storage */ defaultValue?: T; - /** If set to true, value will be update is useEffect after mount */ + /** If set to true, value will be updated in useEffect after mount. Default value is true. */ getInitialValueInEffect?: boolean; /** Function to serialize value into string to be save in storage */