Is there a getError
function?
#4782
Unanswered
matthew-dean
asked this question in
Q&A
Replies: 1 comment
-
Oh! It looks like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Use case
I have a model for a form that, for historical reasons, is deeply nested, but with some optional fields. What's nice about the
defineField
API that is returned formuseForm
is that it gets this deeply nested value, but how do I get the validation errors / valid state?So, for example, I have:
And then I have something like:
But this doesn't work. Not only is this
errors
reference, but it also has to be a flat list, according to TypeScript.What I would really prefer is something more like:
Obviously,
defineField
only allows destructuring as an array (which feels like an API design mistake), but I'm wondering if there's some other API equivalent?Beta Was this translation helpful? Give feedback.
All reactions