title: Axios not cancelling requests
body: <p>I am trying to cancel an Axios request that I made in CompnentDidMount() in ComponentWillUnmount() as everyone says to do. However it does not seem to be working. Like at all.</p>
  <p>Here is the relevant code from my project:</p>
  <pre><code>        //Make API call
          this.setState({ isMounted: true });
          this.axiosCancelSource = Axios.CancelToken.source();
          var result;
          result = await Axios(&quot;/api/product&quot;, { cancelToken: this.axiosCancelSource.token });
          if (this.state.isMounted) {
              this.setState({ products: result.data.products });
          }
  
          
          //this.updateList();
  
  
      }
  
      componentWillUnmount() {
          this.setState({ isMounted: false });
          this.axiosCancelSource.cancel();
      }
  </code></pre>
  <p>and here is a snapshot of my network tab in Chrome DevTools:
  <a href="https://i.stack.imgur.com/hHWas.png" rel="nofollow noreferrer">Network Screenshot</a></p>
  <p>I'm not sure if this is the issue, but it seems like my component mounts and unmount once very quickly then mounts again. I'm not quite sure the cause of this either or if it might be affecting the cancellation of my axios requests. I've scoured the internet for hours trying to solve this, so any help is appreciated. Thanks!</p>