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

root.* error support #107

Open
ViieeS opened this issue Mar 1, 2023 · 1 comment
Open

root.* error support #107

ViieeS opened this issue Mar 1, 2023 · 1 comment

Comments

@ViieeS
Copy link

ViieeS commented Mar 1, 2023

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

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

@bitmensch
Copy link

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
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants