react小知識點

1、render函數何時會執行?
         當this.state/this.props發生改變的時候render函數就會執行

    2、組件第一次執行的時候會執行哪些生命週期
        constructor-->componentWillmount--->render --->componentDidMount

    3、哪些生命週期函數只會執行一次
        constructor
        componentWillMount
        componentDidMount
        componentWillUnmount

    4、哪些生命週期函數會執行屢次
        render
        componentWillReceiveProps
        shouldComponentUpdate
        componentWillUpdate
        componentDidUpdate


    五、當this.state/this.props發生改變的時候會執行哪些生命週期函數
        this.state
            shouldComponentUpdate
            componentWillUpdate
            render
            componentDidUpdate


        this.props
            componentWillReceiveProps
            shouldComponentUpdate
            componentWillUpdate
            render
            componentDidUpdate
相關文章
相關標籤/搜索