首页 > 其他 > 详细

react小知识点

时间:2019-04-19 11:54:34      阅读:112      评论:0      收藏:0      [点我收藏+]
1、render函数什么时候会执行?
         当this.state/this.props发生改变的时候render函数就会执行

    2、组件第一次执行的时候会执行哪些生命周期
        constructor-->componentWillmount--->render --->componentDidMount

    3、哪些生命周期函数只会执行一次
        constructor
        componentWillMount
        componentDidMount
        componentWillUnmount

    4、哪些生命周期函数会执行多次
        render
        componentWillReceiveProps
        shouldComponentUpdate
        componentWillUpdate
        componentDidUpdate


    5、当this.state/this.props发生改变的时候会执行哪些生命周期函数
        this.state
            shouldComponentUpdate
            componentWillUpdate
            render
            componentDidUpdate


        this.props
            componentWillReceiveProps
            shouldComponentUpdate
            componentWillUpdate
            render
            componentDidUpdate

 

react小知识点

原文:https://www.cnblogs.com/Leslie-Cheung1584304774/p/10734663.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!