What problem does it solve?
It prevents form errors and broken UX by ensuring react-hook-form fields validate correctly with Zod, including safe handling of optional Select values in the Veta app.
Core Features & Use Cases
- Zod-powered schema validation: Define a Zod schema and wire it into react-hook-form using zodResolver for consistent validation rules across the form.
- Correct defaultValues for optional fields: Use undefined (not empty strings) in defaultValues to avoid accidental “selected” states and validation mismatches.
- Shadcn/Radix Select compliance rule: Avoid value="" on SelectItem and convert empty values to undefined for optional selections to ensure Radix Select semantics stay correct.
- Consistent form UI components: Use the shared Form, FormField, FormItem, FormControl, and FormMessage components for standardized layout and error rendering.
Quick Start
Create a Zod schema for your form, pass it to useForm via zodResolver, and update your Shadcn Select to map empty selections to undefined while using the shared Form components for field rendering.