Form nested and array values mapPropsToFields not working
See original GitHub issueVersion
2.12.6
Environment
Chrome 60.0.3112.90 OSX (irrelevant in this case)
Reproduction link
https://codepen.io/MathiasGilson/pen/jLapPz
Steps to reproduce
Try to use mapPropsToFields with an array ([{ first: {value: "nameArray"} }]
) or a composed object ({ first: {value: "nestedName"}}
) like in the codepen
What is expected?
This should set the corresponding inputs with the given values getFieldDecorator(‘names[0].first’) input should be set to “nameArray” getFieldDecorator(‘name.first’) input should be set to “nestedName”
What is actually happening?
the input stay empty, no error in the console to debug
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Angular nested form array mapping issue - Stack Overflow
I'm using angular reactive forms which were ok until I stared nesting form arrays. TS file: public questionForm: FormGroup; get answers(): ...
Read more >Nested Dynamic Forms Antd - ADocLib
Within my form data model I have an array of arrays with a format be the name when the second level is also...
Read more >Nested fields - Mantine
Manage nested arrays and object state with use-form hook. ... Set value of `name` field that is contained in object at second position...
Read more >useFieldArray - Simple React forms validation
Important: update data is required and not partial. replace, (obj: object[]) => void, Replace the entire field array values.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s a known issue, I don’t have enough time to dig into it. Need time to re-design data structure and behavior of nested fields.
Sorry about that.
Here is my solution
https://codesandbox.io/s/2z2ojxy22r?fontsize=14