1- import toChildrenArray from 'rc-util/lib/Children/toArray' ;
2- import isEqual from 'rc-util/lib/isEqual' ;
3- import warning from 'rc-util/lib/warning' ;
1+ import toChildrenArray from '@ rc-component/ util/lib/Children/toArray' ;
2+ import isEqual from '@ rc-component/ util/lib/isEqual' ;
3+ import warning from '@ rc-component/ util/lib/warning' ;
44import * as React from 'react' ;
55import FieldContext , { HOOK_MARK } from './FieldContext' ;
66import type {
@@ -112,11 +112,6 @@ export interface FieldState {
112112class Field extends React . Component < InternalFieldProps , FieldState > implements FieldEntity {
113113 public static contextType = FieldContext ;
114114
115- public static defaultProps = {
116- trigger : 'onChange' ,
117- valuePropName : 'value' ,
118- } ;
119-
120115 public state = {
121116 resetCount : 0 ,
122117 } ;
@@ -548,9 +543,10 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
548543 }
549544
550545 // Filed element only
551- const childList = toChildrenArray ( children ) ;
546+ const childList = toChildrenArray ( children as any ) ;
547+
552548 if ( childList . length !== 1 || ! React . isValidElement ( childList [ 0 ] ) ) {
553- return { child : childList , isFunction : false } ;
549+ return { child : childList as React . ReactNode , isFunction : false } ;
554550 }
555551
556552 return { child : childList [ 0 ] , isFunction : false } ;
@@ -566,11 +562,11 @@ class Field extends React.Component<InternalFieldProps, FieldState> implements F
566562 public getControlled = ( childProps : ChildProps = { } ) => {
567563 const {
568564 name,
569- trigger,
565+ trigger = 'onChange' ,
570566 validateTrigger,
571567 getValueFromEvent,
572568 normalize,
573- valuePropName,
569+ valuePropName = 'value' ,
574570 getValueProps,
575571 fieldContext,
576572 } = this . props ;
0 commit comments