import { Control, Controller } from 'react-hook-form';
interface FieldProps {
control: Control<any, any>;
label: string;
fieldName: string;
}
我试图使用泛型类型,但它对我不起作用
import { Control, Controller, FieldValues, Path } from 'react-hook-form';
interface FieldProps<TFieldValues extends FieldValues = FieldValues> {
control: Control<TFieldValues>;
label: string;
fieldName: Path<TFieldValues>;
}