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
23 stars 0 forks source link

form is not correctly typed #1

Open AFusco opened 3 weeks ago

AFusco commented 3 weeks ago

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

TheEdoRan commented 3 weeks 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 3 weeks 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 weeks 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