反応した ES6 アプリでは、次のことを行う必要があります。ある組織の git ハブ メンバーのリストを取得し、その後、それぞれの情報の詳細を取得します。
コード:
handleDevelopers(res){
let lista = res.data.map(function(result) {
axios.get('https://api.github.com/users/'+result.login)
.then(function (response) {
console.log(response.data.name);
return <GitUser key={response.data.id} name={response.data.name}/>;
});
});
this.setState({
users: lista
});
}
componentWillMount() {
axios.get('https://api.github.com/orgs/:orgname/members')
.then((jsonRes) => this.handleDevelopers(jsonRes))
}
マップが完了した後、どのようにsetStateを設定できますか?