dry-scarletD
Refine3y ago
4 replies
dry-scarlet

React-hook-form types

Hi everyone hope you doing all well how to add types for the register functions for the @refinedev/react-hook-form

I just put this code and pass the register function to my custom form component but I can't import the UseFormRegister<FieldValues> types from the react-hook-form

const { refineCore: { onFinish, formLoading }, register, handleSubmit, resetField, formState: { errors }, } = useForm();


<FormRow register={register} labelText='New Password' name='newPassword' type='password' placeholder='Enter new password' />

const FormRow = ({ register, }: { register?: UseFormRegister<FieldValues> }) => { <input {...register(name, { required: true })} className='outline-none border-[1px] border-slate-400 p-2 mb-8 rounded-lg' /> }
Was this page helpful?