zoukankan      html  css  js  c++  java
  • React Component 生命周期

    一般而言 Component 有以下三种生命周期的状态:
    1. Mounting:已插入真实的 DOM
    2. Updating:正在被重新渲染
    3. Unmounting:已移出真实的 DOM

    针对 Component 的生命周期状态 React 也有提供对应的处理方法:

    1. Mounting
      • componentWillMount()
      • componentDidMount()
    2. Updating
      • componentWillReceiveProps(object nextProps):已载入组件收到新的参数时呼叫
      • shouldComponentUpdate(object nextProps, object nextState):组件判断是否重新渲染时呼叫,起始不会呼叫除非呼叫 forceUpdate()
      • componentWillUpdate(object nextProps, object nextState)
      • componentDidUpdate(object prevProps, object prevState)
    3. Unmounting
      • componentWillUnmount()
  • 相关阅读:
    WCF中NetTCp配置
    生产者消费者模式
    MVC 引擎优化
    Wcf
    MongoDB运用
    Sock基础
    WebService
    线程
    委托
    特性
  • 原文地址:https://www.cnblogs.com/wy1935/p/7092916.html
Copyright © 2011-2022 走看看