diff --git a/src/useLocalStorageValue/__docs__/story.mdx b/src/useLocalStorageValue/__docs__/story.mdx index 874d5a1a..aba7440d 100644 --- a/src/useLocalStorageValue/__docs__/story.mdx +++ b/src/useLocalStorageValue/__docs__/story.mdx @@ -53,7 +53,7 @@ function useLocalStorageValue( - **key** _`string`_ - LocalStorage key to manage. - **options** _`object`_ - Hook options: - **defaultValue** _`T | null`_ - Value to return if `key` is not present in LocalStorage. - - **initializeWithValue** _`boolean`_ _(default: false)_ - Fetch storage value on first render. If + - **initializeWithValue** _`boolean`_ _(default: true)_ - Fetch storage value on first render. If set to `false` will make the hook yield `undefined` on first render and defer fetching of the value until effects are executed. diff --git a/src/useSessionStorageValue/__docs__/story.mdx b/src/useSessionStorageValue/__docs__/story.mdx index 0d81c56e..a6475888 100644 --- a/src/useSessionStorageValue/__docs__/story.mdx +++ b/src/useSessionStorageValue/__docs__/story.mdx @@ -52,7 +52,7 @@ function useSessionStorageValue( - **key** _`string`_ - SessionStorage key to manage. - **options** _`object`_ - Hook options: - **defaultValue** _`T | null`_ - Value to return if `key` is not present in SessionStorage. - - **initializeWithValue** _`boolean`_ _(default: false)_ - Fetch storage value on first render. If + - **initializeWithValue** _`boolean`_ _(default: true)_ - Fetch storage value on first render. If set to `false` will make the hook yield `undefined` on first render and defer fetching of the value until effects are executed. diff --git a/src/useStorageValue/useStorageValue.ts b/src/useStorageValue/useStorageValue.ts index ebfb8ea2..be02908b 100644 --- a/src/useStorageValue/useStorageValue.ts +++ b/src/useStorageValue/useStorageValue.ts @@ -120,9 +120,9 @@ export interface UseStorageValueResult< fetch: () => void; } -const DEFAULT_OPTIONS: UseStorageValueOptions = { +const DEFAULT_OPTIONS: UseStorageValueOptions = { defaultValue: null, - initializeWithValue: false, + initializeWithValue: true, }; export function useStorageValue<