📋 Validation resolvers: Yup, Zod, Superstruct, Joi, Vest, Class Validator, io-ts, Nope, computed-types, typanion, Ajv, TypeBox, ArkType, Valibot, effect-ts and VineJS
1.71k
stars
155
forks
source link
Inconsistent reporting of root errors #627
Open
Kirdock opened 11 months ago
Describe the bug Currently, root errors are
onChange
/append
written tomyArray.message
andonSubmit
written tomyArray.root
.To Reproduce Steps to reproduce the behavior:
formState.errors.people.message
formState.errors.people.root.message
Codesandbox link (Required) https://codesandbox.io/s/zod-resolver-root-inconsistency-m57c85?file=/src/App.tsx
Expected behavior I would expect that the array errors are always written to
myArray.root
, no matter ifonChange
oronSubmit
is called.Versions
react-hook-form
: 7.46.0@hookform/resolvers
: 3.3.1