Replies: 1 comment
-
You can do something like
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
I'm trying to use a controlled form with a Select component but I'm getting a Typescript error on the
onValueChange(field.onChange)
Error
What I've tried
I can fix it with something like that
(e: Proficiency) => field.onChange(e)
but I want to avoid hard typing it like that. Why is it not infering the type?Code
Solution I'm looking for
I want the types to automatically infer on the onChange handler with the select options and zod in combination with useForm().
Beta Was this translation helpful? Give feedback.
All reactions