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

issue: validate() accepts returning a string[] array but error messages cannot be accessed #9581

Closed
1 task done
jrmyio opened this issue Dec 13, 2022 · 1 comment
Closed
1 task done
Labels
TS Typescript related issues

Comments

@jrmyio
Copy link

jrmyio commented Dec 13, 2022

Version Number

7.40.0

Codesandbox/Expo snack

https://codesandbox.io/s/broken-snow-9f00jc?file=/src/App.tsx:835-855

Steps to reproduce

Return a string[] from a validate() function:
validate: () => ["error1", "error2"]

Expected behaviour

I expect both errors to be accessible in the errors object, but the error[fieldName].message is an empty string.

What browsers are you seeing the problem on?

No response

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jrmyio jrmyio changed the title issue: validate() accepts a string[] array but removes messages issue: validate() accepts returning a string[] array but error messages cannot be accessed Dec 13, 2022
@bluebill1049
Copy link
Member

bluebill1049 commented Dec 13, 2022

I will fix this type, we wouldn't support an array of strings, as this would cost a breaking change in order to keep.

@bluebill1049 bluebill1049 added the TS Typescript related issues label Dec 13, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
TS Typescript related issues
Projects
None yet
Development

No branches or pull requests

2 participants