field-form icon indicating copy to clipboard operation
field-form copied to clipboard

useForm should return field errors

Open ghmendonca opened this issue 2 years ago • 1 comments

I think useForm or the form instance should return the values and errors when a field value changes. In my case I would like to disable a button if any field has error, and right now it's not possible since getFieldsError() will not always be updated on every render.

ghmendonca avatar Feb 15 '23 07:02 ghmendonca

I think useForm or the form instance should return the values and errors when a field value changes. In my case I would like to disable a button if any field has error, and right now it's not possible since getFieldsError() will not always be updated on every render.

Hello, getFieldsError() is a static method which not obliged to be reactive. You should use another flow with useWatch hook.

Also, you can implement your own logic with getFieldsError().

astakhovaskold avatar Aug 17 '24 22:08 astakhovaskold