mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-27 01:25:52 -05:00
Don't error on null children
Was throwing a `TypeError` when child was null/undefined.
This commit is contained in:
parent
c50ac03a48
commit
b7c46f483e
1 changed files with 1 additions and 0 deletions
|
@ -32,6 +32,7 @@ var Form = React.createClass({
|
|||
return (
|
||||
<Formsy.Form {... this.props} className={classes} ref="formsy" onChange={this.onChange}>
|
||||
{React.Children.map(this.props.children, function (child) {
|
||||
if (!child) return child;
|
||||
if (child.props.name === 'all') {
|
||||
return React.cloneElement(child, {value: this.state.allValues});
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue