Controller for Array Fields #9683
Unanswered
the-avid-engineer
asked this question in
Ideas
Replies: 1 comment
-
Thank you for the idea. Since react-hook-form main goal is to reduce the bundle size as much as possible, it would be great to implement the customer controller separately, may be something like https://github.com/react-hook-form/error-message as a util library. |
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
Uh oh!
There was an error while loading. Please reload this page.
-
I'm aware that a Controller already "works" with array fields, but it is missing something that would be really nice to have.
Imagine the idea (a so-called ArrayController) is nearly identical to the normal Controller, but the render prop method has the object you get by calling
useFieldArray
, probably namedfieldArray
, in addition to thefield
,fieldState
, andformState
objects you normally get as parameters.Then, you don't have to call useFieldArray directly, and all of the methods/fields on the useFieldArray object are readily available when the ArrayController is mounted/not available when it is not mounted.
Thoughts?
Beta Was this translation helpful? Give feedback.
All reactions