From 9134e7e2f32317742d793fdfe707cd40332b79c4 Mon Sep 17 00:00:00 2001 From: Christoph Pader Date: Tue, 11 Jun 2024 17:18:25 +0200 Subject: [PATCH] remove unnecessary check --- lib/useOnyx.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/useOnyx.ts b/lib/useOnyx.ts index f7817940..d673ab8a 100644 --- a/lib/useOnyx.ts +++ b/lib/useOnyx.ts @@ -137,7 +137,7 @@ function useOnyx>(key: TKey // If data is not present in cache and `initialValue` is set during the first connection, // we set the new value to `initialValue` and fetch status to `loaded` since we already have some data to return to the consumer. - if (isFirstConnectionRef.current && !hasCacheForKey && options?.initialValue !== null && options?.initialValue !== undefined) { + if (isFirstConnectionRef.current && !hasCacheForKey && options?.initialValue !== undefined) { newValue = (options?.initialValue ?? undefined) as CachedValue; newFetchStatus = 'loaded'; }