Every time I press on a text input field, the login function is called
This is the touchable statement:
<TouchableOpacity
style={InputFieldStyle.submitButton}
onPress={this.login(this.state.email, this.state.password)}>
<Text style={InputFieldStyle.submitButtonText}>Submit Me</Text>
</TouchableOpacity>
The login function definition:
login = (email, pass) => {
alert(`Email: ${email} Password: ${pass}`);
};
I am currently working on Textinput in my expo project
Is there a way to prevent the login function from being called every time, or am I doing something wrong here?