我在下面的代码在我的孩子图表在所有componentDidMount子项之后调用的父级的componentDidMount?
<div className="all-charts">
<ChartistGraph data={chartData} type="Line" options={options} />
</div>
父
<div>
{
this.state.OSMData.map(function(item, index) {
return <Chart key={index} feature={item} ref="charts" />
})
}
</div>
而下面的代码使我想到父母的componentDidMount是所有孩子的加载后才能调用。但是在这里parent的componentDidMount在child的componentDidMount之前被调用。
这是怎么回事?或者我做错了什么。
如果这是事情的工作方式,我将如何检测何时从父级加载所有子组件?
_The'componentDidMount()'中的子组件的方法之前该父components_的调用:** [链接](https://facebook.github.io/react/docs/组件specs.html#安装-componentdidmount)**。 –
但是,当我console.log父和子componentDidMount()。文本形式的父母console.log首先打印 –
示例小提琴? –