0👍
The action addCategory is async so that’s why you should await it before checking this.validationErrors
async handleSubmit() {
await this.addCategory(this.category);
console.log(this.validationErrors); // returns `null` on first submit
}
OR
handleSubmit() {
this.addCategory(this.category),then(() => {
console.log(this.validationErrors); // returns `null` on first submit
});
}
Source:stackexchange.com