VeeValidate Form state reactivity in large-scale schema validation
0 reputation · 23 Jun 2020, 09:37 UTC
Reactivity Overhead in Complex Forms
VeeValidate v4 offers two primary patterns for managing form state: the declarative Component-based approach (using <Form> and <Field>) and the Composition API approach (using useForm and useField). When integrating centralized schema-based validation via Zod or Yup, the library must synchronize the validation state across all registered fields.
In forms with a high volume of inputs, there is a potential performance trade-off regarding how reactivity is handled. The Composition API provides more granular control over state, while the Component-based approach abstracts the synchronization logic within the Form component's internal state management.
- The goal is to determine the most efficient pattern for minimizing reactivity overhead in very large forms.
- Constraints include maintaining real-time
meta.validupdates while avoiding unnecessary re-renders of the entire form tree.
Does the Composition API significantly reduce reactivity overhead compared to the Component-based approach in large-scale forms? Which pattern is recommended for optimizing performance when using complex Zod schemas?