TS: Simple defaultValues Record<MyFieldNames, string> not assignable to UnpackNestedValue<DeepPartial<Record<TFieldNames, string>>> #3713
Replies: 4 comments 7 replies
-
can you share a codesandbox? |
Beta Was this translation helpful? Give feedback.
-
Any news on this subject ? I'm facing the same issue |
Beta Was this translation helpful? Give feedback.
-
I was surprised to see that the return value from |
Beta Was this translation helpful? Give feedback.
-
+1 to this. I am not able to make a non-hacky generically typed form yet because of this and |
Beta Was this translation helpful? Give feedback.
-
I'd like to avoid doing a typecast when I'm passing a simple object to
useForm({ defaultValues })
.Right now I have something like this:
As a work-around I am just type casting to
UnpackNestedValue<DeepPartial<typeof defaultValues>>
, but would rather not have to use this type casting.defaultValues
is a simple object like{ firstName: string, lastName: string }
Beta Was this translation helpful? Give feedback.
All reactions