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 object from both formState and fieldState are always undefined with useController #11829

Closed
1 task done
weihungchin opened this issue Apr 28, 2024 · 1 comment

Comments

@weihungchin
Copy link

weihungchin commented Apr 28, 2024

Version Number

7.29.0

Codesandbox/Expo snack

https://codesandbox.io/p/sandbox/usecontroller-own-state-forked-9v83s5?file=%2Fsrc%2FApp.tsx

Steps to reproduce

  1. Go to 'https://codesandbox.io/p/sandbox/usecontroller-own-state-forked-9v83s5?file=%2Fsrc%2FApp.tsx'
  2. Type a number less than 10 in the input
  3. Check the console log output
  4. Notice that the error is undefined (which is not the expected output)

Expected behaviour

The error should not be undefined when the form is invalid with rules set for the useController

What browsers are you seeing the problem on?

Chrome

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@weihungchin weihungchin changed the title issue: useController fieldState error object is always undefined issue: error object from both formState and fieldState are always undefined with useController Apr 28, 2024
@jbgrunewald
Copy link

I just noticed we can read from the fieldState that the controller returns. Though I'm wondering if that is also not working correctly based on the change you made to the title @weihungchin?

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

No branches or pull requests

3 participants