File tree 1 file changed +2
-1
lines changed
packages/taro-components-rn/src/components/Form
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class _Form extends React.Component<FormProps> {
56
56
}
57
57
58
58
deppDiveIntoChildren = ( children : React . ReactNode ) : React . ReactNode => {
59
- return React . Children . toArray ( children ) . map ( ( child : any ) => {
59
+ const result = React . Children . toArray ( children ) . map ( ( child : any ) => {
60
60
const childTypeName = child . type && child . type . name
61
61
if ( ! child . type ) return child
62
62
if ( childTypeName === '_Button' && [ 'submit' , 'reset' ] . indexOf ( child . props . formType ) >= 0 ) {
@@ -74,6 +74,7 @@ class _Form extends React.Component<FormProps> {
74
74
? this . bindValueChangeEvent ( child )
75
75
: React . cloneElement ( child , { ...child . props } , this . deppDiveIntoChildren ( child . props . children ) )
76
76
} )
77
+ return result . length ? result : null
77
78
}
78
79
79
80
submit = ( ) : void => {
You can’t perform that action at this time.
0 commit comments