Skip to content

useForm: Conflicting type for setError and clearErrors when nested data. #185

@mpressen

Description

@mpressen

In useForm.d.ts, we have :

setError(field: keyof TForm, value: string): void;
clearErrors: (...fields: (keyof TForm)[]) => void;

Using nested_attributes and Zod for front validation, I have to clearErrors('annual_finances_attributes.0.year') per instance, which is not allowed by Typescript, while, I think, is still standard rails practice.

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