我在我的本机应用程序中使用此功能,但它使我的应用程序崩溃,尽管它在我的模拟器上显示错误作为控制台,我应该如何使用警报向用户显示任何错误而不是使应用程序崩溃?
signup =(email,password) =>{
try{
firebase.auth().createUserWithEmailAndPassword(email,password)
.then(() => this.props.navigation.navigate('home')) }
catch(error){
alert("not valid"`enter code here`)
}
}
Run Code Online (Sandbox Code Playgroud)