forge42dev / remix-hook-form

Open source wrapper for react-hook-form aimed at Remix.run
MIT License
330 stars 27 forks source link

Property 'root' does not exist on type #58

Closed mauriciovillam closed 2 months ago

mauriciovillam commented 9 months ago

Hello! I believe the library may be using the wrong type for the errors property of formState. Perhaps it should use FieldErrors rather than FieldErrorsImpl.

Also, the "root" error doesn't populate back in the formState if passed from the actions.

image image image image

"root" is supported by react-hook-form

image
adamshiervani commented 9 months ago

I have the same issue. I need a field to put my general server errors into. I'm quite sure this used to work, but not after the 3.x updates

AlemTuzlak commented 9 months ago

Pinpointed the issue, will be fixed in next release!

adamshiervani commented 9 months ago

Wonderful. Appreciate it!

mauriciovillam commented 9 months ago

Thank you @AlemTuzlak !!

AlemTuzlak commented 9 months ago

I've made the errors have the correct type with 3.2.3 and looking into making the root error be populated and work

adamshiervani commented 8 months ago

Any updates?

AlemTuzlak commented 8 months ago

Should work with the latest version of react and remix hook form I believe

AlemTuzlak commented 2 months ago

I think this works now, feel free to re-open if I'm wrong but I've tested it locally and all is good