I have the code below in my render of parent
<div>
{
this.state.OSMData.map(function(item, index) {
return <Chart key={index} feature={item} ref="charts" />
})
}
</div>
And code below in my child Chart
<div className="all-charts">
<ChartistGraph data={chartData} type="Line" options={options} />
</div>
I thought the componentDidMount of parent is called only after all childs are loaded. But here the componentDidMount of parent is called before the componentDidMount of child.
Is this how things work? Or am I doing something wrong.
If this is how things work, how would I detect when all the child components are loaded from parent?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…