Access current ref of fieldState error #10942
Unanswered
timheerwagen
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I want to access the ref of a component that contains an error to check if a parent element contains it to display the error status on the parent element.
Working Example without rhf:
I can't seem to find a reference in rhf that contains the node.
Not working with rhf:
formState.errors[1]?.ref contains only focus, select... but not the node.
Am I missing something here or is there another way for the desired behavior?
Beta Was this translation helpful? Give feedback.
All reactions