react中componentWillMount死循环

componentDidMount:this method executed once during the component’s life.
componentDidMount:有可能执行多次,所以一般在刚到页面就调接口获取信息的,需要写在componentDidMount中,防止在WillMount中的多次调用。

《React :引领未来的用户界面开发框架》

挂载:将组建渲染,并构建DOM元素然后插入页面的过程。

猜你喜欢

转载自blog.csdn.net/qq_36934775/article/details/85132105