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: error in Array schemas don't surface #126

Open
bastibuck opened this issue Jun 20, 2023 · 1 comment
Open

issue: error in Array schemas don't surface #126

bastibuck opened this issue Jun 20, 2023 · 1 comment

Comments

@bastibuck
Copy link

Version Number

1.8.0

Codesandbox/Expo snack

https://codesandbox.io/s/react-ts-form-example-forked-38ykmt?file=/src/App.tsx

Steps to reproduce

  1. Click submit without checking a checkbox
  2. Data is being logged
  3. Check a checkbox, no error is still visible although the validation should fail (due to uuid())
  4. Click submit, data is not being logged

The issue is that errors coming from zod don't seem to surface into the error coming from useTsController(). The submit is disabled correctly but no error can be shown.

If you remove the uuid() part the submit works fine.

Expected behaviour

Array schema validation errors should also surface when using useTsController inside a field component.

Maybe I'm just doing something wrong but the codesandbox and my local solution provide just the same output where the error is never changed on actual falsy inputs.

Relevant log output

No response

@bastibuck
Copy link
Author

PS: The errors returned from the RHF useForm is correct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant