For that to work your push should add a function component, which also render children
props inside:
const group = []
for (let i = 0; i < 4; i++) {
group.push((props) => <div className="parent">{props.children}</div>)
}
return (
<>
{group.map((Item, i) => <Item key={i}><div className="child">child {i}</div></Item> )}
</>
);
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…