useFieldArray rules validate prop behaviour #10867
Unanswered
martynasgz
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.
Uh oh!
There was an error while loading. Please reload this page.
-
I wanted to use the
validate
rules
prop on the useFieldArray but realized that it behaves in a different way than I expected. It seems to validate only when the field array is appended/removed/replaced/... to, or the form is submitted. I'd expect it to validate according to the validation strategy specified in themode
prop of useForm, when the inputs of the field array themselves are interacted with. Is this the expected behaviour? Is there a way of achieving what I want? Here's the sandbox that I've modified from #8102 to display the issue: https://codesandbox.io/s/react-hook-form-usefieldarray-rules-forked-pj44rr?file=/src/index.jsBeta Was this translation helpful? Give feedback.
All reactions