score:5

Accepted answer
 let {content} = this.state;
 $.getJSON(url,function(data){
              let result = data.map(e=>e.body);
              this.setState({content:content.concat(result)}); 
         }.bind(this));

score:0

ReactDOM.render(
    <InterBox title="Hello"></InterBox>,
    document.getElementById('main')
);

score:0

$.getJSON(url, function(data){
    for (var i = 0; i < data.length; i++) {
        var element = data[i];
        tempdata.push(element.body);
        console.log(tempdata);
        this.setState({"content":tempdata});
    }
});

Related Query

More Query from same tag