Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useForm should return field errors #569

Open
ghmendonca opened this issue Feb 15, 2023 · 1 comment
Open

useForm should return field errors #569

ghmendonca opened this issue Feb 15, 2023 · 1 comment

Comments

@ghmendonca
Copy link

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
Copy link

astakhovaskold commented Aug 17, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants