I have the following code in my React component render method
render: function() {
return (
<div>
<div>div1</div>
<div>div2</div>
{this.getOtherDivs()}
</div>
);
},
getOtherDivs: function() {
return ([
<div>div3</div>,
<div>div4</div>
]);
},
However, these two divs div3 and div4 are nested into single array instead of being separate.
When I do children.length for the top most div, I am getting 3 instead of 4.
I don't want to wrap the last two divs in an enclosing div.
children.length? Where exactly does that come from? Also, what version of React are you using?