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.

Question about dynamic fields in ArrayField Nested Form approach

See original GitHub issue

Hi Joe,

I am trying ArrayField to generate dynamic fields using custom component inputs.

I added 3 sets of fields and filled all the fields. When I tried to remove the second one, the third one was also removed.

matrixdynamic

Here is some part of my code.

https://gist.github.com/KLC215/34f8ecf60488b3670fc5a35f4015f2a1

  • MainPage.js is the usage part
  • MatrixDynamic.js renderFields(fields) is the render part

I tried to use copy this example

https://joepuzzo.github.io/informed/?path=/story/arrays--nested-form

and replaced origin inputs to my custom input, it works as expected.

So my question is, What is the best practice / correct way to render dynamic fields inside ArrayField?

Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:20 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
joepuzzocommented, Feb 25, 2020

Awesome glad I could help

0reactions
joepuzzocommented, Mar 2, 2020

Check that you are passing the key correctly. I bet its the same issue as originally

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to sum the value from dynamic nested array field and ...
I assume I have problem with creating on the form or my approaches are wrong. Please help me to accomplish my objective generate...
Read more >
V6 - React Hook Form - building dynamic form (Field Array)
In this video tutorial, we are going to through how to build a dynamic form with useFieldArray and useWatch.
Read more >
2 levels nested array field · Discussion #8266 - GitHub
I have one more question - how do i replace fields and children with rounds and scrim ? I'm talking about the actual...
Read more >
I changed my implementation of an EXTREMELY deeply ...
I changed my implementation of an EXTREMELY deeply nested Angular Reactive Form and you won't believe what happened. Do you have a deeply...
Read more >
MongoDB - $push Operator - GeeksforGeeks
In this example, we are appending multiple values, i.e., [89, 76.4] to an array field, i.e., personal.semesterMarks field of a nested/embedded ...
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