zoukankan      html  css  js  c++  java
  • A12 React+AntDesign React 生命周期函数

    React 生命周期函数

    /*   
    生命周期函数
        组件加载之前,组件加载完成,组件更新数据以及组件销毁触发的一系列方法---这就是组件的生命周期函数

    组件加载的时候触发的生命周期函数:

        constructor、UNSAFE_componentWillMount(老版本为componentWillMount,已废弃)、
        render、componentDidMount

    组件更新的时候触发的生命周期函数:

        shouldComponentUpdate(有两个参数nextProps,nextState)、 
        UNSAFE_componentWillUpdate(老版本为componentWillUpdate,已废弃)、
        render、componentDidUpdate

    你在父组件里面改变props传值的时候触发的:

        componentWillReceiveProps

    组件销毁时触发的生命周期函数:

        UNSAFE_componentWillReceiveProps(老版本为componentWillUnmount,已废弃)

    */

    //新版本React以rename的生命周期函数
    // componentWillMount → UNSAFE_componentWillMount
    // componentWillReceiveProps → UNSAFE_componentWillReceiveProps
    // componentWillUpdate → UNSAFE_componentWillUpdate
     

     

     

     

     

     
  • 相关阅读:
    异常总结201304
    Android开发资料[20121125]
    大素数的生成
    django 获取用户IP地址
    python包管理工具pip
    mysql大表修改结构
    素数的检测
    一致性哈希算法 python实现
    素数的生成筛选法
    相似哈希simhash
  • 原文地址:https://www.cnblogs.com/nuister/p/12459737.html
Copyright © 2011-2022 走看看