issue: Type issues with string array when using useFieldArray hook #11592
Replies: 5 comments
-
More details as the issue template didnt had any description field: Just to note that on my code, it also throws type error on append() function
Moreover, I have also made a feature.tsx file with my code to reproduce the issue with my code. Although my code works normally except the type error. If required, I can setup a minimal reproducible repo with my code. |
Beta Was this translation helpful? Give feedback.
-
Your codesandbox is inaccessible. |
Beta Was this translation helpful? Give feedback.
-
Didnt notice it was private. Changed visibility to public. Please lemme know what other details to provide. |
Beta Was this translation helpful? Give feedback.
-
From the
So the solution would be to convert |
Beta Was this translation helpful? Give feedback.
-
But it appears to work even with simple type. Edit: Although I can surely modify my useForm schema and map over the data array to extract the value in a separate array when saving to DB. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Version Number
^7.50.1
Codesandbox/Expo snack
https://codesandbox.io/p/sandbox/react-hook-form-usefieldarray-forked-2vtmkp?file=%2Fsrc%2Findex.tsx%3A10%2C45
Steps to reproduce
Expected behaviour
No type error. It should work normally with string based array as it does it custom object based array.
What browsers are you seeing the problem on?
none, type error thrown in IDE
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions