Very usefull for beginner for react hook forms Subscibed 🔔✅ React Hook Form Basic Understanding : 9 / 10 Typescript for input: 9 / 10 (Taking input props suggestion into parent component) Note: After installing any javascript lib we don't need to install pod here yup & hook form resolvers are pure js lib they dont have any native or any platform specific implimentation e.g. for android in java or kotlin & for iOS object c or swift so we can void pod installation 👍
Just a tiny suggestion if you want strongly typed submit function and remove the squiggly lines in control prop, Go with Zod instead of Yup(API is almost same) and add types and default values to useForm hook. like this useForm({ resolver: zodResolver(formSchema), defaultValues: { emergency: "", height: 80, weight: 140, }, });
Sorry, I added it and Control keeps returning the following Type 'Control' is not assignable to type 'Control'. Types of property '_reset' are incompatible. Type 'UseFormReset' is not assignable to type 'UseFormReset'. Types of parameters 'values' and 'values' are incompatible. Type 'FieldValues | { [x: string]: any; } | ResetAction | undefined' is not assignable to type '{ password: string; username: string; phoneNumber: string; firstName: string; lastName: string; } | { password?: string | undefined; username?: string | undefined; phoneNumber?: string | undefined; firstName?: string | undefined; lastName?: string | undefined; } | ResetAction | undefined'. Type 'ResetAction' is not assignable to type '{ password: string; username: string; phoneNumber: string; firstName: string; lastName: string; } | { password?: string | undefined; username?: string | undefined; phoneNumber?: string | undefined; firstName?: string | undefined; lastName?: string | undefined; } | ResetAction | undefined'. Type 'ResetAction' is not assignable to type 'ResetAction'. Type 'FieldValues' is not assignable to type '{ password: string; username: string; phoneNumber: string; firstName: string; lastName: string; }'.ts(2322) FormInputController.tsx(5, 3): The expected type comes from property 'control' which is declared here on type 'IntrinsicAttributes & FormInputControllerProps'
Very usefull for beginner for react hook forms
Subscibed 🔔✅
React Hook Form Basic Understanding : 9 / 10
Typescript for input: 9 / 10 (Taking input props suggestion into parent component)
Note: After installing any javascript lib we don't need to install pod here yup & hook form resolvers are pure js lib they dont have any native or any platform specific implimentation e.g. for android in java or kotlin & for iOS object c or swift so we can void pod installation
👍
Just a tiny suggestion if you want strongly typed submit function and remove the squiggly lines in control prop, Go with Zod instead of Yup(API is almost same) and add types and default values to useForm hook. like this
useForm({
resolver: zodResolver(formSchema),
defaultValues: {
emergency: "",
height: 80,
weight: 140,
},
});
Sorry, I added it and Control keeps returning the following Type 'Control' is not assignable to type 'Control'.
Types of property '_reset' are incompatible.
Type 'UseFormReset' is not assignable to type 'UseFormReset'.
Types of parameters 'values' and 'values' are incompatible.
Type 'FieldValues | { [x: string]: any; } | ResetAction | undefined' is not assignable to type '{ password: string; username: string; phoneNumber: string; firstName: string; lastName: string; } | { password?: string | undefined; username?: string | undefined; phoneNumber?: string | undefined; firstName?: string | undefined; lastName?: string | undefined; } | ResetAction | undefined'.
Type 'ResetAction' is not assignable to type '{ password: string; username: string; phoneNumber: string; firstName: string; lastName: string; } | { password?: string | undefined; username?: string | undefined; phoneNumber?: string | undefined; firstName?: string | undefined; lastName?: string | undefined; } | ResetAction | undefined'.
Type 'ResetAction' is not assignable to type 'ResetAction'.
Type 'FieldValues' is not assignable to type '{ password: string; username: string; phoneNumber: string; firstName: string; lastName: string; }'.ts(2322) FormInputController.tsx(5, 3): The expected type comes from property 'control' which is declared here on type 'IntrinsicAttributes & FormInputControllerProps'