We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dcb5cf5 commit 826a7d1Copy full SHA for 826a7d1
src/useWatch.ts
@@ -6,7 +6,8 @@ import type { InternalFormInstance, NamePath, Store } from './interface';
6
import { useState, useContext, useEffect, useRef } from 'react';
7
import { getNamePath, getValue } from './utils/valueUtil';
8
9
-type GetGeneric<Type> = Type extends FormInstance<infer ValueType> ? ValueType : never;
+type ReturnPromise<T> = T extends Promise<infer ValueType> ? ValueType : never;
10
+type GetGeneric<TForm extends FormInstance> = ReturnPromise<ReturnType<TForm['validateFields']>>;
11
12
function useWatch<
13
TDependencies1 extends keyof GetGeneric<TForm>,
0 commit comments