more laxist input types while keeping tight output types
I implemented a wrapper around the
used as:
it does work well to one exception: i wished to add that the type representing the form's values (i guess,
i get a type mismatch
1. Is there a way to decouple the form values
2. Or is there another way to achieve what i want to do?
useForm param to avoid having to pass the whole defaultValues data structure when creating a form (which honestly is quite cumbersome when all values are undefined by default). i had to combine the types of the input schema and default values in order to stitch back the form types to make tsc happy. here's the function:used as:
it does work well to one exception: i wished to add that the type representing the form's values (i guess,
typeof defaultValues) would be wrapped Partial to support the pristine and reset states of the inputs from types PoV. When i change:i get a type mismatch
Types of property 'defaultValues' are incompatible.. I'm a bit lost at this error because i only declare (and cast) the defaultValues so the comparison with another defaultValues might not come from me.1. Is there a way to decouple the form values
defaultValues from the rest of the lib2. Or is there another way to achieve what i want to do?