Don't error on null children

Was throwing a `TypeError` when child was null/undefined.
This commit is contained in:
Ray Schamp 2016-07-05 15:48:21 -04:00
parent c50ac03a48
commit b7c46f483e

View file

@ -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 {