From 196bba3fda1a595b168b5b3a21f59bef652441d8 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Mon, 19 Jan 2015 14:08:40 +0100 Subject: [PATCH] Call onSuccess and onSubmitted from props after AJAX response --- src/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.js b/src/main.js index 1202921..4e84ab9 100644 --- a/src/main.js +++ b/src/main.js @@ -225,8 +225,8 @@ Formsy.Form = React.createClass({ ajax[this.props.method || 'post'](this.props.url, this.model, this.props.contentType || options.contentType || 'json', headers) .then(function (response) { - this.onSuccess(response); - this.onSubmitted(); + this.props.onSuccess(response); + this.props.onSubmitted(); }.bind(this)) .catch(this.failSubmit); },