react小知识点

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
原文地址:https://www.cnblogs.com/Leslie-Cheung1584304774/p/10734663.html