You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a schema: const schema = object({ array: array().of(object({...})) .test('error', array => ...) })
My validation mode is 'onBlur'.
I have a test on the array, which checks all array elements for some condition.
The problem is that I can not get the error before actually submitting the form.
useFormState({control, name: 'array'}).errors does not update even when doing form.trigger('array').
I can see the code inside test method being run, but the result does not get populated into errors.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
How can I achieve the following:
I have a schema:
const schema = object({ array: array().of(object({...})) .test('error', array => ...) })
My validation mode is 'onBlur'.
I have a test on the array, which checks all array elements for some condition.
The problem is that I can not get the error before actually submitting the form.
useFormState({control, name: 'array'}).errors does not update even when doing form.trigger('array').
I can see the code inside test method being run, but the result does not get populated into errors.
Is this a bug or an intentional behaviour?
Beta Was this translation helpful? Give feedback.
All reactions