Skip to content

root.* error support #107

Description

@ViieeS

The component doesn't support new root.* error type, eg name="root.serverError"

Type '"root.serverError"' is not assignable to type FormData

Activity

  1. bitmensch commented on Jul 3, 2023

    @bitmensch

    I ran into the same issue today.

    In my case I set a custom error that got returned from the server after submitting a form:

    setError("root.failure", {
        type: data.failure.reason,
    });
    

    I expected the following code to display the error message for root.failure, but it didn't:

    <ErrorMessage errors={errors} name="root.failure" />
    

    Instead, not using ErrorMessage component in this case worked:

    <p>{errors.root?.failure?.type}</p>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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