React生命周期執行順序


//組件加載的時候
    constructor(props){
        super(props)
        this.state = {
            msg:'張學友'
        }
    }
    //組件將要掛載
    componentWillMount(){
        
    }
    //數據渲染
    render(){
        
    }
    //組件掛載完成的時候
    componentDidMount(){
        
    }

    //組件數據更新的時候

    //是否需要更新
    shouldComponentUpdate(){
        return true
    }
    //將要更新
    componentWillUpdate(){

    }
    //更新完成
    componentDidUpdate(){

    }
    render(){

    }
    //父組件里面改變props傳值的時候出發
    componentWillReceiveProps(){

    }
    //組件銷毀
    componentWillUnmount(){

    }

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM