The way to do this without any Flux implementation is to create a function on the parent element that processes the response / data from the child element and passes this function as a support. Then call this function from the child. Something like that:
:
handleResponse(data) {
console.log(data)
}
render() {
return(
<div>
<Child handleResponse={this.handleResponse} />
</div>
);
}
child:
handleAjax() {
$.get(url).then( (response) => {
this.props.handleResponse(response)
});
}
ES6. ES5, bind var that = this .