• React 生命周期理解


    页面初始化的时候生命周期函数执行顺序是   

    componentWillMount('组件将要挂载到页面时刻')---------->render('组件正在被渲染'时刻)----------->componentDidMount('组件挂载完成时刻')

    页面组件更新时候生命周期函数执行顺序是

    shouldComponentWillUpdate('组件更新之前')---------->componentWillUpdate('组件即将更新')---------->render('组件正在被渲染')---------->

    componentWillReceiveProps(在初始props不会被调用,它会在组件接受到新的props时调用,一般用于父组件更新状态时子组件的重新渲染,它是在不进行额外的render的前提下,

    响应props中的改变并更新state的唯一方式)---------->componentDidUpdate('组件更新完成')

    重命名的生命周期

    componentWillMount---------->UNSAFE_componentWillMount
    
    
    
    componentWillUpdate---------->UNSAFE_componentWillUpdate
    
    
    componentWillReceiveProps---------->UNSAFE_componentWillReceiveProps
  • 相关阅读:
    cf854B Maxim Buys an Apartment
    Snuke's Coloring 2-1
    P1087 FBI树
    Card Game for Three
    Many Formulas
    排队
    苹果消消乐(尺取法)
    猴子选大王(约瑟夫)
    进制转化
    UIProgress控件的属性和方法
  • 原文地址:https://www.cnblogs.com/h5it/p/14060192.html
Copyright © 2020-2023  润新知