React - Ajax Requests
//English Hi Guys, today I'm going to expose hot to make Ajax requests with React, It's pretty straight forward...(At the end you will see the link to my plunker, to see it working...) Basically you just create your Class: var ReactAjax = React.createClass({ getInitialState : function(){ return { plunks : [] } }, render : function(){ var plunks = this.state.plunks; return ( <div id="container"> <div className="row"> <div className="col-xs-4 col-xs-offset-4"> <button onClick={this.fetchPlunks} className="btn btn-default">Get My(brion25) Plunks</button> </div> </div> <PlunksList plunks={plunks} /> </div> ); } }); And on the event, it could be either a click, change, etc. you just make the requests: fetchPlunks : function(){ var self = this; jQuery.ajax({ ...