如何在React中做Ajax 请求

如何在React中做Ajax 请求


慕田峪4524236
浏览 742回答 1
1回答

30秒到达战场

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,查看更多内容
随时随地看视频慕课网APP