mercredi 26 août 2020

React native calling a function from a conditional statement inside onPress

I have the following code but it does not work

The first part is working fine and zi get the alert but the second one ia not

<Button onPress={ 

     if (this.state.value===""){ alert("try again"); } else { this.functionToBeCalled }

}

Aucun commentaire:

Enregistrer un commentaire