Made passing all props, except `onSubmit`

This commit is contained in:
Semigradsky 2015-06-23 12:54:57 +03:00
parent c394ce0925
commit c37c053a66
1 changed files with 5 additions and 7 deletions

View File

@ -98,7 +98,7 @@ Formsy.Form = React.createClass({
return this.props.mapping(this.model)
} else {
return Object.keys(this.model).reduce(function (mappedModel, key) {
var keyArray = key.split('.');
while (keyArray.length) {
var currentKey = keyArray.shift();
@ -435,12 +435,10 @@ Formsy.Form = React.createClass({
},
render: function () {
return React.DOM.form({
onSubmit: this.submit,
className: this.props.className,
autoComplete: this.props.autoComplete
},
this.traverseChildrenAndRegisterInputs(this.props.children)
return (
<form {...this.props} onSubmit={this.submit}>
{this.traverseChildrenAndRegisterInputs(this.props.children)}
</form>
);
}