What is the exact usage of componentWillUpdate in ReactJS?

Posted by Rohit Kumar | Updated on

In this example, I have shared what is the exact usage of componentWillUpdate in ReactJS? The componentWillUpdate gives you control to manipulate the component just before it receives new props or state. I generally use it to do animations. Let us say, I want to smoothly fade an element out of the view, before removing the dom.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers