Skip to content

Commit 92f3126

Browse files
authored
fix(rn): image in form bug (#11459)
1 parent 0764246 commit 92f3126

File tree

1 file changed

+2
-1
lines changed
  • packages/taro-components-rn/src/components/Form

1 file changed

+2
-1
lines changed

packages/taro-components-rn/src/components/Form/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class _Form extends React.Component<FormProps> {
5656
}
5757

5858
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) => {
6060
const childTypeName = child.type && child.type.name
6161
if (!child.type) return child
6262
if (childTypeName === '_Button' && ['submit', 'reset'].indexOf(child.props.formType) >= 0) {
@@ -74,6 +74,7 @@ class _Form extends React.Component<FormProps> {
7474
? this.bindValueChangeEvent(child)
7575
: React.cloneElement(child, { ...child.props }, this.deppDiveIntoChildren(child.props.children))
7676
})
77+
return result.length ? result : null
7778
}
7879

7980
submit = (): void => {

0 commit comments

Comments
 (0)