@@ -49,10 +49,10 @@ interface ChildProps {
49
49
[ name : string ] : any ;
50
50
}
51
51
52
- export interface InternalFieldProps {
52
+ export interface InternalFieldProps < Values = any > {
53
53
children ?:
54
54
| React . ReactElement
55
- | ( ( control : ChildProps , meta : Meta , form : FormInstance ) => React . ReactNode ) ;
55
+ | ( ( control : ChildProps , meta : Meta , form : FormInstance < Values > ) => React . ReactNode ) ;
56
56
/**
57
57
* Set up `dependencies` field.
58
58
* When dependencies field update and current field is touched,
@@ -78,7 +78,7 @@ export interface InternalFieldProps {
78
78
isListField ?: boolean ;
79
79
}
80
80
81
- export interface FieldProps extends Omit < InternalFieldProps , 'name' > {
81
+ export interface FieldProps < Values = any > extends Omit < InternalFieldProps < Values > , 'name' > {
82
82
name ?: NamePath ;
83
83
}
84
84
@@ -498,7 +498,7 @@ class Field extends React.Component<InternalFieldProps, FieldState, InternalForm
498
498
}
499
499
}
500
500
501
- const WrapperField : React . FC < FieldProps > = ( { name, ...restProps } ) => {
501
+ function WrapperField < Values = any > ( { name, ...restProps } : FieldProps < Values > ) {
502
502
const namePath = name !== undefined ? getNamePath ( name ) : undefined ;
503
503
504
504
let key : string = 'keep' ;
@@ -514,6 +514,6 @@ const WrapperField: React.FC<FieldProps> = ({ name, ...restProps }) => {
514
514
}
515
515
516
516
return < Field key = { key } name = { namePath } { ...restProps } /> ;
517
- } ;
517
+ }
518
518
519
519
export default WrapperField ;
0 commit comments