mercredi 21 août 2019

How can I set modalView in false?

I would like that on Click of a touchableopacity my app changes the modal state in false

constructor(props) {
    super(props);
    this.state = {
        modalVisible: true,
        first: true,
    }
}
checkIfFirstLog = () => {
    this.setState = {first: false}

    if (this.state.first = false) {
        this.setState = {
            modalVisible: false
        }
    }
}
<Modal           
      <TouchableOpacity onPress={() => this.checkIfFirstLog() }>

      </TouchableOpacity>   
 </Modal>

Aucun commentaire:

Enregistrer un commentaire