react-component / field-form

⚡️ React Performance First Form Component
https://field-form.react-component.now.sh/
MIT License
975 stars 264 forks source link

useForm should return field errors #569

Open ghmendonca opened 1 year ago

ghmendonca commented 1 year ago

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.

astakhovaskold commented 1 month ago

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().