ReactJS setState when all nested Axios calls are finished
问题 I have a problem with updating my state from nested axios call inside forEach loop: constructor(props) { super(props); this.state = { isLoaded: false, items: [] }; //Binding fetch function to component's this this.fetchFiles = this.fetchFiles.bind(this); } componentDidMount() { this.fetchFiles(); } fetchFiles() { axios.get('/list') .then((response) => { var items = response.data.entries; items.forEach((item, index) => { axios.get('/download'+ item.path_lower) .then((response) => { item.link =