epic-stack icon indicating copy to clipboard operation
epic-stack copied to clipboard

form.errors alway undefined

Open braginteractive opened this issue 1 year ago • 1 comments

I might be missing something here, but when using <ErrorList errors={form.errors} id={form.errorId} /> form.errors is always undefined even when the form has errors.

If you log form.allErrors you get an object of all the form errors though.

braginteractive avatar Sep 23 '24 20:09 braginteractive

Thanks for the issue! I'd be happy to accept a PR for this.

kentcdodds avatar Sep 23 '24 21:09 kentcdodds

@kentcdodds I would love to fix this issue. Can I go on?

AyendiSimeon1 avatar Dec 02 '24 06:12 AyendiSimeon1

Sure!

kentcdodds avatar Dec 02 '24 06:12 kentcdodds

form.errors contains the errors of the form that aren't tied to a specific input (path: ""). If I type the wrong combination of username/password, form.errors is ['Invalid username or password'], for example.

I think this works as intended!

markuslewin avatar Feb 04 '25 14:02 markuslewin