So, I wanna display navbar depending on if the user is logged in or not, but while logging out it gives me the exception that it cannot read that property.
That’s the error:
“Exception in delivering result of invoking ‘logout’: TypeError: Cannot read property ‘isLoggedIn’ of undefined”
And my code:
Logout(){
Meteor.logout(e => {
if(e) {
console.log(e);
} else {
this.setState({
isLoggedIn: !this.state.isLoggedIn
});
FlowRouter.go("/");
console.log(this.state.isLoggedIn);
}
});
}