issue: useFieldArray replace function breaks on version 7.45.1 #10642
Unanswered
maiyaacovi
asked this question in
Q&A
Replies: 1 comment 5 replies
-
Please re-check your code base to see if prop ![]() In your codesandbox url https://codesandbox.io/s/react-hook-form-usefieldarray-forked-kv8ps5?file=/src/index.tsx, it was using react-hook-form 8 alpha version where default key name is ![]() I've checked version 7.45.1 and it seems working normally: https://codesandbox.io/s/react-hook-form-usefieldarray-forked-s92kxz?file=/src/index.tsx:2783-2790 |
Beta Was this translation helpful? Give feedback.
5 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.
-
Version Number
7.45.1
Codesandbox/Expo snack
https://codesandbox.io/s/react-hook-form-usefieldarray-forked-kv8ps5?file=/src/index.tsx
Steps to reproduce
The 'replace' function should replace all the fields in the array, but we can see that its not affecting existing fields. For example, if I have array of two fields, and I replace them with two different fields, it won't replace. If I replace them with three different fields, only the third one is added.
On codesandbox I used version 8.0.0-alpha.4 since there was no version 7.45.1, but its the exact same bug that happens to me with version 7.45.1.
Thanks!
Expected behaviour
fields should now be 'test1' and 'test2'
What browsers are you seeing the problem on?
Chrome
Relevant log output
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions