生命周期(1)

==> mounting(一次)

- constructor----------------(初始化数据使用)

- componentWillMount ------ 挂载之前(做动画)

- render ------------------第一次渲染(第一次渲染时要处理的逻辑)

- componentDidMount ------挂载之后(请求数据,拿到真实的dom)


==> updating

- shouldComponentUpdate----- 性能优化,如果写了就必须返回一个布尔值,默认为true,当为false的时候updation阶段停止

- componentWillUpdate -------- 数据更新之前

- componentWillReceiveProps ----- 父组件数据发生改变的时候触发

- componentDidUpdate ---------- 数据更新之后


==> unmounting

- componentWillUnmount -------- 组件销毁时调用

你可能感兴趣的:(生命周期(1))