VeeValidate v4 and Yup/Zod schema replacement: re-validation and stale errors
0 reputation · 08 Jul 2022, 10:25 UTC
VeeValidate v4 useForm accepts a validationSchema option that delegates rule evaluation to Yup or Zod. The integration is intended to keep form values, touched state, and the errors object reactive to user input and configured validation-on events.
The precise goal is to clarify the interoperability boundary when the schema object is replaced at runtime, for example to make a field optional or to remove a field entirely. It is not clear from the current planning context whether a schema reference change is treated as a validation trigger, and whether errors produced under a prior schema are cleared automatically or persist in the errors object.
Does changing validationSchema cause an automatic re-validation of existing values? Are errors for fields omitted from the new schema removed without an explicit call to validate() or resetForm()? Is the behavior documented consistently for Yup and Zod integrations in VeeValidate v4?