FieldTemplate children are in an array
See original GitHub issuePrerequisites
- I have read the documentation;
- In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.
- Ideally, I’m providing a sample JSFiddle or a shared playground link demonstrating the issue.
Description
Since release 1.2.0 (and more specifically #1118), children passed to FieldTemplate are in an array.
Steps to Reproduce
- Open the playground on the Simple example.
- Using the React Developer Tools, inspect the first FieldTemplate component and its props.

Expected behavior
children should be a node.
Actual behavior
children is an Array with 2 extra null items.
Version
1.2.0
Issue Analytics
- State:
- Created 5 years ago
- Reactions:3
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Custom Templates - react-jsonschema-form documentation
Each of the items represent a child with properties described below. ... To fully customize an array field template, you may need to...
Read more >Custom UI in react jsonschema form for ArrayFieldTemplate
I want to show the input type="text" and button inside a table. There are few other fields also in the array {element.children.props.formData} ...
Read more >Loop through child elements in Twig like Element::children()
I have created a Twig filter that returns back with the children as an ArrayIterator . mymodule ...
Read more >How to render individual field values instead of {{ children }}
By default, the template just dumps out {{ children }} and ... {{ dump(_context|keys) }} = array(21) { [0]=> string(7) "element" [1]=> ...
Read more >JavaScript Drop Down Box Configuration - DevExtreme
Built-in buttons should also be declared in this array. ... In the following code, the fieldTemplate is used to stylize the text field...
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 Free
Top 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

It depends and in theory could be a breaking change. If anyone was cloning
props.childrenthroughcloneElement()and doing something with contents then it will break after merge. Because developer will get onefragmentinstead offieldalong with optionalanyOf,oneOfplaceholders. But I do not know if anyone would do that ever.Also it is not clear what issue creator @mlbstrm was doing with
childrenfor this to be an issue at all. Same question could be asked @ketysek as he mentioned that was a problem for his field templates.In addition to the above if this is something meant only for
v2then PR could be merged.v2implies there are breaking changes anyway.fixed by #1709