title: react-native-camera barcode scanner freezes, because it scans too fast
body: <p>I am trying to use the barcode scanner from <code>react-native-camera</code>. First, off it scans a QR-code and extracts a String, after that it navigates to the next Screen with <code>react-navigation</code>. In the second screen, it makes an API-call. </p>
  
  <p>Now if I go back to the scanner screen, de QR-code will be scanned immediately. That's where I run into an error and the scanner freezes. I usually get this error: </p>
  
  <pre><code>Can't call setState (or forceUpdate) on an unmounted component
  </code></pre>
  
  <p>I think it's because my <code>componentWillUnmount</code> cleanup doesn't work properly or fast enough, but I already cancel the axios request. </p>
  
  <pre><code>       requestCode = (code) =&gt; {
          if (cancel != undefined) {
            cancel();
          }
          axios.get(API_URI + code, {
            cancelToken: new CancelToken(function executor(c) {
              cancel = c;
            })
          }).then(response =&gt; {
            console.log(response)
            //checks if code was already called
            this.checkUsed(response.data)
          })
            .catch(error =&gt; {
              this.setState({ isValid: false })
            });
          }
  
      componentWillUnmount() {
          cancel();
        }
  </code></pre>
  
  <p>Maybe I could mount the camera-scanner a little bit later so it doesn't scan this fast or is it maybe even an error with React Navigation?</p>