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

fieldErrors is not cleaned up after submit #23

Open
marcopiii opened this issue Mar 26, 2024 · 0 comments
Open

fieldErrors is not cleaned up after submit #23

marcopiii opened this issue Mar 26, 2024 · 0 comments

Comments

@marcopiii
Copy link
Member

The object fieldErrors: Partial<Record<keyof Values, NonEmptyArray<FieldError>>> returned by useFormo is not properly cleaned up after each submit of the form: if it contained a key foo with some validation error after such error is resolved the key is not removed from the object, instead, its value is set to undefined.

As a consequence using Object.keys(fieldErrors).length > 0 to detect if there is any validation error gives false positives.

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

1 participant