error-message
error-message copied to clipboard
root.* error support
The component doesn't support new root.* error type, eg name="root.serverError"
Type '"root.serverError"' is not assignable to type FormData
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>