When using Formik and useField() hook with Typeahead, meta.error is typed as undefined | string, but Typeahead provides errors as string[] if there are errors with inputs
Expected behavior
meta.error should be typed as undefined | string | string[]
Note: Having a property on useField({..., array: true}) to determine if error is of type string[] wouldn't work, because the validation MAY fail with the field directly (required, ..) and not with the inputs
Bug report
Current Behavior
When using Formik and
useField()
hook with Typeahead,meta.error
is typed asundefined | string
, butTypeahead
provides errors asstring[]
if there are errors with inputsExpected behavior
meta.error
should be typed asundefined | string | string[]
Note: Having a property on
useField({..., array: true})
to determine if error is of typestring[]
wouldn't work, because the validation MAY fail with the field directly (required, ..) and not with the inputsYour environment