Skip to content

Commit d16222a

Browse files
author
Zach Silveira
authored
Fix to render recursively correctly.
1 parent 80be5ce commit d16222a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

form.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ export default class Form extends React.Component {
99

1010
renderChildren(children) {
1111
return React.Children.map(children, (child, index) => {
12-
if (child.children)
13-
return React.cloneElement(child, this.renderChildren(child.children));
12+
if (child.props.children)
13+
return React.cloneElement(child, {
14+
...child.props,
15+
children: this.renderChildren(child.props.children)
16+
});
1417
if (child.type.name !== 'TextInput') return child;
1518

1619
return React.cloneElement(child, {

0 commit comments

Comments
 (0)