diff --git a/lib/useOnyx.ts b/lib/useOnyx.ts index aa51af64..958170bb 100644 --- a/lib/useOnyx.ts +++ b/lib/useOnyx.ts @@ -14,8 +14,8 @@ import Onyx from './Onyx'; type UseOnyxValue = string extends TKey ? unknown : TKey extends CollectionKeyBase - ? Readonly>> - : Readonly>>; + ? NonNull> + : NonNull>; type BaseUseOnyxOptions = { /** @@ -55,11 +55,7 @@ type UseOnyxOptions = BaseUseOnyxOptions & U type FetchStatus = 'loading' | 'loaded'; -type CachedValue = IsEqual> extends true - ? TValue - : TKey extends CollectionKeyBase - ? Readonly>> - : Readonly; +type CachedValue = IsEqual> extends true ? TValue : TKey extends CollectionKeyBase ? NonNullable> : TValue; type ResultMetadata = { status: FetchStatus;