title: How to prevent multiple Alerts in React Native?
body: <p>Is there a way to tell if there was an Alert.alert() already on the screen before sending another one?</p>
  
  <p>I have this function:</p>
  
  <pre><code>CheckInternet(){
    if(this.props.json.undefined){
      Alert.alert("Check your internet connection");
    }
  }
  
  ComponentDidUpdate(){
    this.CheckInternet();
  }
  </code></pre>
  
  <p>The thing is that I have other things being done inside that function, I just wrote the relevant code, so I cannot take the <code>CheckInternet</code> function outside <code>ComponentDidUpdate</code>.</p>
  
  <p>The problem is that the component updates twice after getting the <code>json</code>, therefore, sending that alert twice. I would like to prevent having two alerts at the same time by using a condition that would let me know if there is an alert on the screen already or not. I don't seem to find anything like that in the Alert documentation. Any ideas?</p>