1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-31 09:07:48 +01:00

Also execute child's handleSuccess() instead of just overwriting it in ModalWrapper

This commit is contained in:
Brett Sun 2015-12-18 14:57:10 +01:00
parent 089c4ad009
commit 311d03d09c

View File

@ -46,7 +46,13 @@ let ModalWrapper = React.createClass({
renderChildren() {
return ReactAddons.Children.map(this.props.children, (child) => {
return ReactAddons.addons.cloneWithProps(child, {
handleSuccess: this.handleSuccess
handleSuccess: (response) => {
if (typeof child.props.handleSuccess === 'function') {
child.props.handleSuccess(response);
}
this.handleSuccess(response);
}
});
});
},