Question
How do you access the error type set by `setError` in your form's error object?
Asked by: USER7423
79 Viewed
79 Answers
Answer (79)
You can access the error type through the `errors` object. For example, if you used `setError('myField', { type: 'customError', message: 'Something went wrong' })`, you can access the type via `errors.myField.type`, which would return `'customError'`.