猿问

如何在React中做Ajax 请求

如何在React中做Ajax 请求


阿波罗的战车
浏览 523回答 2
2回答

明月笑刀无情

setTimeout(function () {callback({username: 'xxx', age: 10});}, 10);}var App = React.createClass({getInitialState: function () {return {data: {}};},handleSubmit: function (model) {console.log(model);//TODO},componentDidMount: function () {loadCommentsFromServer('url', {}, function (data) {this.setState({data: data});}.bind(this));},render: function () { 
随时随地看视频慕课网APP
我要回答