I'm trying to build list of forms based on array of objects, those objects have fields that should have the ability to be edited, and be rendered as inputs, and readonly fields that don't need to be rendered, for example id.
I do that by using useFieldArray
hook. However, react hook seems to save only those fields that are registered as inputs, which results in my id field getting lost in submit handler.
How do I preserve my readonly fields?
Here's sandbox example, so you can get what I am talking about. I added id to default value and to value that gets appended. When you click submit id is no longer there.