Skip to content

Commit

Permalink
fix(rn): image in form bug (#11459)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqingchen authored Mar 16, 2022
1 parent 0764246 commit 92f3126
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/taro-components-rn/src/components/Form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class _Form extends React.Component<FormProps> {
}

deppDiveIntoChildren = (children: React.ReactNode): React.ReactNode => {
return React.Children.toArray(children).map((child: any) => {
const result = React.Children.toArray(children).map((child: any) => {
const childTypeName = child.type && child.type.name
if (!child.type) return child
if (childTypeName === '_Button' && ['submit', 'reset'].indexOf(child.props.formType) >= 0) {
Expand All @@ -74,6 +74,7 @@ class _Form extends React.Component<FormProps> {
? this.bindValueChangeEvent(child)
: React.cloneElement(child, { ...child.props }, this.deppDiveIntoChildren(child.props.children))
})
return result.length ? result : null
}

submit = (): void => {
Expand Down

0 comments on commit 92f3126

Please sign in to comment.