@@ -49,10 +49,10 @@ interface ChildProps {
4949 [ name : string ] : any ;
5050}
5151
52- export interface InternalFieldProps {
52+ export interface InternalFieldProps < Values = any > {
5353 children ?:
5454 | React . ReactElement
55- | ( ( control : ChildProps , meta : Meta , form : FormInstance ) => React . ReactNode ) ;
55+ | ( ( control : ChildProps , meta : Meta , form : FormInstance < Values > ) => React . ReactNode ) ;
5656 /**
5757 * Set up `dependencies` field.
5858 * When dependencies field update and current field is touched,
@@ -78,7 +78,7 @@ export interface InternalFieldProps {
7878 isListField ?: boolean ;
7979}
8080
81- export interface FieldProps extends Omit < InternalFieldProps , 'name' > {
81+ export interface FieldProps < Values = any > extends Omit < InternalFieldProps < Values > , 'name' > {
8282 name ?: NamePath ;
8383}
8484
@@ -498,7 +498,7 @@ class Field extends React.Component<InternalFieldProps, FieldState, InternalForm
498498 }
499499}
500500
501- const WrapperField : React . FC < FieldProps > = ( { name, ...restProps } ) => {
501+ function WrapperField < Values = any > ( { name, ...restProps } : FieldProps < Values > ) {
502502 const namePath = name !== undefined ? getNamePath ( name ) : undefined ;
503503
504504 let key : string = 'keep' ;
@@ -514,6 +514,6 @@ const WrapperField: React.FC<FieldProps> = ({ name, ...restProps }) => {
514514 }
515515
516516 return < Field key = { key } name = { namePath } { ...restProps } /> ;
517- } ;
517+ }
518518
519519export default WrapperField ;
0 commit comments