0
ユーザーのリストがありますが、各ユーザーの詳細をどのようにクリックすればいいですか?ClickHandlerを使用してユーザーの詳細を表示
このコンポーネントでapi呼び出しを行う必要がありますか?
ずっとここ
に感謝すべてのヘルプは、私のユーザーのリストです:ユーザの詳細に移動するには
class App extends Component {
constructor(props) {
super(props);
this.state = {users: []};
}
getUsers(){
axios.get('http://jsonplaceholder.typicode.com/users')
.then((response) => {
this.setState({ users: response.data });
})
.catch((error) => {
console.log(error);
});
}
componentDidMount(){
this.getUsers();
}
render() {
return (<div>
<Users users={this.state.users} />
</div>);
}
}
export default App;
返信ありがとうございます、 'reactx'を' redux'なしで使用することはできますか?どこに私のapi呼び出しを入れますか? – Bomber