Skip to content

Commit

Permalink
Revert "fix(useStorageValue): Set initializeWithValue to false by def…
Browse files Browse the repository at this point in the history
…ault"

This reverts commit 3207d0d.
  • Loading branch information
ArttuOll committed Nov 4, 2022
1 parent 3207d0d commit 527867f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/useLocalStorageValue/__docs__/story.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function useLocalStorageValue<T>(
- **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.

Expand Down
2 changes: 1 addition & 1 deletion src/useSessionStorageValue/__docs__/story.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function useSessionStorageValue<T>(
- **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.

Expand Down
4 changes: 2 additions & 2 deletions src/useStorageValue/useStorageValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ export interface UseStorageValueResult<
fetch: () => void;
}

const DEFAULT_OPTIONS: UseStorageValueOptions<null, false> = {
const DEFAULT_OPTIONS: UseStorageValueOptions<null, true> = {
defaultValue: null,
initializeWithValue: false,
initializeWithValue: true,
};

export function useStorageValue<
Expand Down

0 comments on commit 527867f

Please sign in to comment.