Why Do I Need to Manually Specify Types with useField in vee-validate and Yup? #4897
federicobartoli
started this conversation in
General
Replies: 1 comment 3 replies
-
With const schema = z.object({
name: z.string().min(1)
})
const { value } = useField('name', toTypedSchema(schema.shape.name)) I suppose the reason you would need to be manual about it is that form values could be deep nested objects, and |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using vee-validate with Yup in a TypeScript project. To get the correct TypeScript types for my form fields, I find myself having to manually specify the type for each field like this:
Is there a way to obtain the field types without manually specifying them for each field? What's the recommended practice for allowing vee-validate to automatically infer the types from my Yup schemas?
Beta Was this translation helpful? Give feedback.
All reactions