You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fetchRepos(){// cancel the previous requestif(this.source){this.source.cancel('Operation canceled due to new request.')}// save the new request for cancellationthis.source=axios.CancelToken.source();this.setState({networkState: 'loading'})leturl=`https://api.github.com/users/${this.props.username}/repos`axios.get(url,{cancelToken: this.source.token}).then(response=>this.setState({repos: response.data,networkState: 'loaded'})).catch(error=>{if(axios.isCancel(error)){this.setState({networkState: 'canceled'})}else{this.setState({networkState: 'errored'})}});}
The text was updated successfully, but these errors were encountered:
Example code (facebook/react#8883 (comment)):
The text was updated successfully, but these errors were encountered: