title: Cancel a fetch request in react-native
body: <p>Is there any way to abort a fetch request on react-native app ?</p>
  
  <pre><code>class MyComponent extends React.Component {
    state = { data: null };
  
    componentDidMount = () =&gt;
      fetch('http://www.example.com')
        .then(data =&gt; this.setState({ data }))
        .catch(error =&gt; {
          throw error; 
        });
  
    cancelRequest = () =&gt; {
     //???
    };
  
    render = () =&gt; &lt;div&gt;{this.state.data ? this.state.data : 'loading'}&lt;/div&gt;;
  }
  </code></pre>
  
  <p>i tried the <code>abort</code> function from <code>AbortController</code> class but it's not working !!</p>
  
  <pre><code>...
  abortController = new window.AbortController();
  
  cancelRequest =  () =&gt; this.abortController.abort();
  
  componentDidMount = () =&gt;
          fetch('http://www.example.com', { signal: this.abortController.signal })
            ....
  </code></pre>
  
  <p>Any help please !</p>