title: how to make the pop-up (alert) appears just once and not several times?
body: <p>I'm coding in react native ( I'm new with this technologie ) and I created a pop-up who is supposed to appear juste once 
  so when I pressed the button to go on the next view of my application the pop up shows up ( which is good and what I want )
  my problem is that when I pressed the button to take a picture ( basically it's a view like a normal camera to take a picture <a href="https://i.stack.imgur.com/zDHRz.png" rel="nofollow noreferrer">enter image description here</a>) the pop up shows up and when I press the button to access the frontal camera the pop up shows up also 
  so basically it's working but it's not what I want </p>
  
  <p>in summary , when I navigate on this view , I want the pop up to appear just once , and when I press the others buttons I don't want the pop up to show up and that exactly my actual problem </p>
  
  <p>here is my entire code : </p>
  
  <pre><code>import { Camera  } from 'expo-camera';
  import * as Permissions from 'expo-permissions';
  import { FontAwesome, Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons';
  import React from 'react';
  import {Alert, StyleSheet, Text, View, TouchableOpacity, AppRegistry} from 'react-native';
  
  
  
  import * as MediaLibrary from 'expo-media-library';
  
  export default class Cam extends React.Component {
  
  
  constructor (props) {
    super (props)
  
    this.state = {
      hasPermission : null,
      setHasPermission : null,
      type : Camera.Constants.Type.back,
      statut : null,
      hasCamerollPermission: null,
    }
  }
  
  takePicture = async () =&gt;  {
    if (this.camera) {
      this.camera.takePictureAsync().then(data =&gt; {
        let saveResult = data
  
          // On demande l'acces à la camera roll
          let access = MediaLibrary.getPermissionsAsync()
  
          if (access === 'granted') {
            MediaLibrary.createAssetAsync(saveResult.uri) // On sauvegade l'image dans la camera ro
            console.log("Voici le résultat");
            console.log(saveResult)
          }else {
            console.log("Vous n'avez pas accès à cette option ");
            MediaLibrary.requestPermissionsAsync().then(() =&gt; {
  
              console.log("Permission autorisée");
              MediaLibrary.createAssetAsync(saveResult.uri)
              console.log("Voici le résultat");
              console.log(saveResult)
            }).catch((e) =&gt; {
              console.log(e);
            })
          }
  
      });
    }
  };
  
  render (){
  
  
    return (
  &lt;&gt;
  
      &lt;TouchableOpacity onPress= {Alert.alert(
        'Pour de meilleurs résultats, assurez-vous que le chapeau et le stipe du champignon soient bien visibles'
        )}&gt;
  
      &lt;/TouchableOpacity&gt;
  
      &lt;View style={{ flex: 1 }}&gt;
        &lt;Camera style={{ flex: 1 }} type={this.state.type}  ref={ref =&gt; {this.camera = ref;}}&gt;
          &lt;View
            style={styles.styleCamera1}&gt;
            &lt;TouchableOpacity
              style={styles.styleCamera2}
              onPress={() =&gt; {
                console.log("yousri");
                if (this.state.type == Camera.Constants.Type.back) {
  
                  this.setState ({
                    type : Camera.Constants.Type.front
                  })
                }else {
                  this.setState ({
                    type : Camera.Constants.Type.back
                  })
                }
  
              }}&gt;
  
              &lt;MaterialIcons
                  name="camera-front"
                  style={styles.Icons}
              /&gt;
            &lt;/TouchableOpacity&gt;
  
              &lt;TouchableOpacity
              style={styles.styleCamera2}
              onPress = {() =&gt; {
                //On verifie que la référence est bien donnée (à la caméra)
                var perm =  Camera.requestPermissionsAsync()
  
                perm.then(() =&gt; {
                  console.log(".");
                  this.setState ( {hasPermission : true} )
  
                  console.log("Prend une photo");
                  this.takePicture();
  
                }).catch ((erreur) =&gt; {
                  console.log(erreur);
                })
                {this.takePicture.bind(this)}
              } }
              &gt;
              &lt;MaterialIcons
                    name="camera"
                    style={styles.Icons}
                  //  borderRadius = {0}
  
                /&gt;
  
            &lt;/TouchableOpacity&gt;
            &lt;TouchableOpacity
            onPress={() =&gt; {this.props.navigation.navigate('Galerie')}}
            style={styles.styleCamera2}
            &gt;
            &lt;Ionicons
            name="ios-photos"
            style={styles.Icons}
        /&gt;
  
          &lt;/TouchableOpacity&gt;
  
          &lt;/View&gt;
        &lt;/Camera&gt;
      &lt;/View&gt;
      &lt;/&gt;
    )
  }
  }
  const styles = StyleSheet.create({
      styleCamera1:{
  
          flex: 1,
          backgroundColor: 'transparent',
          flexDirection: 'row',
          justifyContent: 'space-around',
          marginBottom: 20,
  
      },
      styleCamera2:{
  
          flex: 0.1,
          alignSelf: 'flex-end',
          alignItems: 'center',
  
      },
      Icons:{
        color: "#fff",
         fontSize: 45
       }
    })
  
  </code></pre>
  
  <p>here is the specified part where I wrote the alert </p>
  
  <pre><code>  return (
  &lt;&gt;
  
      &lt;TouchableOpacity onPress= {Alert.alert(
        'Pour de meilleurs résultats, assurez-vous que le chapeau et le stipe du champignon soient bien visibles'
        )}&gt;
  
      &lt;/TouchableOpacity&gt;
  
  
  
  </code></pre>
  
  <p>tank you for your help </p>