渲染。 我知道有这集中展示在数据被取出装载其他相关的帖子,但我是有点不同。 我在渲染方法来呈现网格(具有更多的数据),其需要较长的时间的逻辑。在这种情况下,渲染函数将不会显示加载,因为它仍在处理逻辑。 任何帮助,将不胜感激。reactjs问题显示加载而DOM与我现在面临的问题与展示,而DOM是呈现装载更多的逻辑
例如,
class DataGrid extends React.Component {
constructor(props, context) {
this.state = {isLoading : false}
}
render(){
//logic to render.
..
..
..
//takes long time
return(
<div>
<Loader isLoading={this.state.isLoading} /> // This will not work since render is not complete
<OtherComponent />
</div>
)
}
}
说实话,如果它确实需要那么多的时间,你应该移动这种逻辑别处 – stinodes