mirror of
https://github.com/ascribe/onion.git
synced 2025-01-03 10:25:08 +01:00
Also execute child's handleSuccess()
instead of just overwriting it in ModalWrapper
This commit is contained in:
parent
089c4ad009
commit
311d03d09c
@ -46,7 +46,13 @@ let ModalWrapper = React.createClass({
|
|||||||
renderChildren() {
|
renderChildren() {
|
||||||
return ReactAddons.Children.map(this.props.children, (child) => {
|
return ReactAddons.Children.map(this.props.children, (child) => {
|
||||||
return ReactAddons.addons.cloneWithProps(child, {
|
return ReactAddons.addons.cloneWithProps(child, {
|
||||||
handleSuccess: this.handleSuccess
|
handleSuccess: (response) => {
|
||||||
|
if (typeof child.props.handleSuccess === 'function') {
|
||||||
|
child.props.handleSuccess(response);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.handleSuccess(response);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user