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

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

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

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

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

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

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

    重命名的生命周期

    componentWillMount---------->UNSAFE_componentWillMount
    
    
    
    componentWillUpdate---------->UNSAFE_componentWillUpdate
    
    
    componentWillReceiveProps---------->UNSAFE_componentWillReceiveProps
  • 相关阅读:
    如何知道电脑是几核?
    宝塔服务器管理助手Linux面版使用教程
    阿里云服务器怎么更换系统盘

    MoonScript
    webmin
    requests 0.7.6
    盘古搜索
    c练习总结
    Download a webpage using CURL in C
  • 原文地址:https://www.cnblogs.com/h5it/p/14060192.html
Copyright © 2011-2022 走看看