Skip to content

fieldErrors is not cleaned up after submit #23

Open
@marcopiii

Description

@marcopiii

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions