title: onPress event doesn't work on react-native
body: <p>It shows me only the alert message Idk why.
  This is the code.</p>
  <p>The function that handle signups doesn't Work. I've tried in every manner but I can't solve it. I'm a junior web developer and can't resolve this problem. I should use Hook but I like oop.</p>
  <pre><code>class Login extends Component {    
  
      state = {email: &quot;&quot;, password:&quot;&quot;, userdata:{}}
  
      handleSignUp(email,password) {
   
        Alert.alert(  
          'Alert Title',  
          'My Alert Msg',  
          [  
              {  
                  text: 'Cancel',  
                  onPress: () =&gt; console.log('Cancel Pressed'),  
                  style: 'cancel',  
              },  
              {text: 'OK', onPress: () =&gt; console.log('OK Pressed')},  
          ]  
      );  
  }
  
        
  
  
  &lt;Button title=&quot;Ciao&quot; onPressButton ={this.handleSignUp(this.state.email,this.state.password)} style={styles.button}&gt;&lt;/Button&gt;
  {/*&lt;TouchableOpacity onPress ={this.handleSignUp(this.state.email,this.state.password)} style={styles.button} &gt;
  &lt;Text  &gt;Registrati&lt;/Text&gt;
    &lt;/TouchableOpacity&gt;*/}
          &lt;/View&gt;
    )
      }
  }
  </code></pre>