diff --git a/src/main.js b/src/main.js index 7edb786..c2eaa43 100644 --- a/src/main.js +++ b/src/main.js @@ -424,9 +424,23 @@ Formsy.Form = React.createClass({ this.validateForm(); }, render: function () { + var { + mapping, + validationErrors, + onSubmit, + onValid, + onInvalid, + onInvalidSubmit, + onChange, + reset, + preventExternalInvalidation, + onSuccess, + onError, + ...nonFormsyProps + } = this.props; return ( -
); diff --git a/tests/Formsy-spec.js b/tests/Formsy-spec.js index 1a52e5b..aae9c1a 100755 --- a/tests/Formsy-spec.js +++ b/tests/Formsy-spec.js @@ -350,7 +350,7 @@ export default { }, - 'should trigger onChange when form element is changed': function (test) { + 'should trigger onChange once when form element is changed': function (test) { const hasChanged = sinon.spy(); const form = TestUtils.renderIntoDocument( @@ -359,12 +359,12 @@ export default { ); TestUtils.Simulate.change(TestUtils.findRenderedDOMComponentWithTag(form, 'INPUT'), {target: {value: 'bar'}}); - test.equal(hasChanged.called, true); + test.equal(hasChanged.calledOnce, true); test.done(); }, - 'should trigger onChange when new input is added to form': function (test) { + 'should trigger onChange once when new input is added to form': function (test) { const hasChanged = sinon.spy(); const TestForm = React.createClass({ @@ -394,7 +394,7 @@ export default { const form = TestUtils.renderIntoDocument(