Question
In the context of this exercise, does the componentWillUpdate()
method always get invoked?
Answer
No, not always. The componentWillUpdate()
method is only invoked immediately after the shouldComponentUpdate()
method returns true
.
If shouldComponentUpdate()
returns false
, then all the following methods, componentWillUpdate()
, render()
, and componentDidUpdate()
will not be invoked.