How to pass typesafe react-hook-form form object
I'm using react-hook-form to handle update user profile form.
I'm also using uploadthing for image upload (updating user profile pic), so I've created a custom upload button component and I'm passing to it a form, so I could setValue manually when upload is complete.
Inside UploadButtonProps I've declared form prop as a UseFormReturn type like this
So, the problem is now when I'm trying to use form to setValue I do not have typesafety.
How to achieve typesafety? I'm also using zod for form schema.
0 Replies