In the following code:
updateErrorMessage(message) {
this.setState({
errorMessage: message
})
},
registerUser() {
if (this.state.password === this.state.password2) {
Accounts.createUser({
email: this.state.email,
password: this.state.password
}, function (error) {
if (!error) {
FlowRouter.go('/');
} else {
this.updateErrorMessage(error.reason);
}
});
} else {
this.updateErrorMessage("Passwords do not match.");
}
},
I am getting the following error when this function is executed
Exception in delivering result of invoking 'createUser': TypeError: this.updateErrorMessage is not a function
Are React functions not available in the scope of the callback?