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.
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.