- 挂载卸载过程
- constructor()
- componentWillMount() 组件渲染前
- componentDidMount() 组件渲染后
- componentWillUnmount () 组件销毁前
- 更新过程
- componentWillReceiveProps (nextProps) props改变前
- shouldComponentUpdate(nextProps,nextState) 组件是否更新(渲染) state改变或props改变后执行
- componentWillUpdate (nextProps,nextState) 组件更新(渲染) 前
- componentDidUpdate(prevProps,prevState) 组件更新(渲染) 后
- render() 组件渲染
react 生命周期
最新推荐文章于 2024-04-07 10:15:00 发布