question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

remove from useFieldArray doesn't work correctly

See original GitHub issue

Please consider asking the question at our spectrum channel.

https://spectrum.chat/react-hook-form

Describe the question?

To Reproduce Steps to reproduce the behavior:

  1. use useFieldArray
  2. Append new members
  3. removeing doesn’t work as expected, deletes other members than the one needed

Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-usefieldarray-zs0lp

Additional context I couldn’t replicate my issue as I experienced it, but I also had an issue where removeing a member would completely wipe my array

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:26 (12 by maintainers)

github_iconTop GitHub Comments

30reactions
bluebill1049commented, Sep 11, 2020

@bluebill1049 whats up~ I think I love your library? Haven’t fully decided yet, but its def fun.

v. 6.8.0

I’m having the same issue. heres a CSB - https://codesandbox.io/s/react-hook-form-field-array-append-remove-df816?file=/src/index.js

append some fields and assign different values and see the remove, removing random ones. Any ideas?

Screen Shot 2020-09-11 at 3 25 28 pm

make sure you go through the doc with the important note, i think you are missing the id

3reactions
changyeamooncommented, Sep 11, 2020

@bluebill1049 Wow, that was it. Must’ve missed it. Thanks for the thorough documentation ❤️.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UsefieldArray react hook form deleting the last element only
Basically I'm trying to append and delete but the problem is when I'm deleting its deleting only the last element. append is working...
Read more >
React Hook Form - useFieldArray - Remove ERROR
A custom hook for working with Field Arrays (dynamic inputs). ... Forked FromReact Hook Form - useFieldArray; Environmentcreate-react-app.
Read more >
useFieldArray - Simple React forms validation
Performant, flexible and extensible forms with easy-to-use validation.
Read more >
Problem with useFieldArray with react-hook-form - JavaScript
For some reason I have a particular form setup with useFieldArray but the remove/append method is bugged. I have not encounter this problem ......
Read more >
Form - Atom Learning
You don't need to pass error to your component manually; the Form will pass it in ... to make the dynamic fields work...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found