next-safe-action / adapter-react-hook-form

Seamlessly integrate next-safe-action with react-hook-form.
https://www.npmjs.com/package/@next-safe-action/adapter-react-hook-form
MIT License
38 stars 0 forks source link

form is not correctly typed #1

Open AFusco opened 2 months ago

AFusco commented 2 months ago

It appears that useHookFormAction returns form as UseFormReturn<any, any> when ideally it should return UseFormReturn<z.infer<typeof mySchema>, any>

TheEdoRan commented 2 months ago

It's working fine on my end 🤔

image

Have you tried to reload the editor window? Maybe it's just a caching issue.

AFusco commented 2 months ago

I tried reloading and it doesn't work. Can you show the code behind your screenshot? I was simply colling useHookFormAction() Do I have to call useHookFormAction?

TheEdoRan commented 2 months ago

I've used the login form of this repo's example app:

https://github.com/next-safe-action/adapter-react-hook-form/blob/53d306711643becdfcdb2a96d9a5c9c243243895/apps/example/src/app/login/login-form.tsx#L9-L20