Commit b7c46f48 authored by Ray Schamp's avatar Ray Schamp

Don't error on null children

Was throwing a `TypeError` when child was null/undefined.
parent c50ac03a
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment