Joined February 2016
·

The French Bakery

Paris
·
·

Posted to Intro to React over 1 year ago

Hi, and thanks for the interesting post.
I'm right in the middle of trying to make node.js react and jQuery working together and I'm struggling. In your nice post you say that Ajax requests should go in the componentDidMount of a React class.
And yet, in your example, you write:
componentWillMount: function(){
var self = this;
$.get('/api/posts', function(posts){
self.setState({posts: posts})
});
}
Is there a specific reason for that?
Thanks.
G.

Achievements
1 Karma
0 Total ProTip Views