Keyboard.dismiss() not working when I implement firebase login. The keyboard stays up on to the next page where you have to manually close it. Does anyone know how to get the keyboard to go away?
When I commenting my firebase authentication code then keyboard.dismiss() work perfectly.
here is my working code snippet
but when I comment out of firebase authentication code Keyboard.dismiss() not working why happen this?
code:
handleLogin = () => {
Keyboard.dismiss();
this.setState({ isLoading: true });
const { email, password } = this.state;
firebase
.auth()
.signInWithEmailAndPassword(email, password)
.catch(function(error) {
Alert.alert('Error', error.message);
})
.then(response => {
this.setState({ isLoading: false });
if (response) {
this.setState({ isSuccessful: true });
this.storeName(response.user.email);
setTimeout(() => {
this.props.closeLogin();
this.setState({ isSuccessful: false });
setTimeout(() => {
Alert.alert('Congrats', "You've logged successfully!");
}, 200);
}, 1000);
}
});
};