I am using Accounts.createUser to create accounts in DB.it works and creates accounts but after it i am trying to navigate home screen but its not working for some reason.
register = () => {
console.log("i got called")
const options = {
email:this.state.email,
username:this.state.username,
password:this.state.password,
reservations:[]
}
//this.setState({loading:true});
Accounts.createUser(options),function(err){
if(err){
console.log(error)//no errors in console.
}else{ //succesfully creates user
console.log("lets navigate!") // not working this code is not executed.
this.props.navigation.navigate('Home');
}
}
};