Type 'string' is not assignable to type 'never' when using useFieldArray with TS #7260
Unanswered
imed-computas
asked this question in
Q&A
Replies: 2 comments 5 replies
-
can you share a simple codesandbox? |
Beta Was this translation helpful? Give feedback.
3 replies
-
You need to have object[] not just string[] that was the issue for me instead of emails: ['', ''] i had to do emails: [{email: ''}] |
Beta Was this translation helpful? Give feedback.
2 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 am trying to use useFieldArray to keep track of to arrays in a component which is part of a bigger form with strong typing. I take control and register of the validate ts type in as parameteres, but when i try to specify name for my useFieldArrays i get the the error message saying "Type 'string' is not assignable to type 'never' The expected type comes from property 'name' which is declared here on type 'UseFieldArrayProps<OurType, never, "id">'
Anyone experiencing that has experienced the same issue and found a solution?
Beta Was this translation helpful? Give feedback.
All reactions