How to properly type useFieldArray in a custom component? #12251
Unanswered
branislavbrincko
asked this question in
General
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 want to make a custom component that will use
useFieldArray
and will acceptcontrol
andname
foruseFieldArray
as props.What I am struggling with is how to type
fields
- I want to make sure user passes form control, that hasnameLocalizations
field with{ locale: 'en' | 'sk'; value: string }[]
structure. So I did this:I expected the
fields[0]
to havelocale
andvalue
fields, but this is not the case:What am I doing wrong? How to make sure the
fields
is typed correctly? Thanks for any helpBeta Was this translation helpful? Give feedback.
All reactions