Basically I want to know when the component calls
componentWillReceiveProps lifecycle method.
In simple terms, when the props are updated. I have used this lifecycle method while using Redux, as Redux basically passes the data to the component as Props, so you need a method that shall be triggered when the props are updated. Why? Because, a component is not re-rendered unless there is a change in state ( not props ). So we usually update the state in the componentWillRecieveProps method using the props we just received to make sure the component re-renders as soon as we receive the new props.
You can use this interactive lifecycle simulators to learn about it
Vishwa Bhat
Technology Enthusiast
If it helps:
cdn-images-1.medium.com/max/1600/0*VoYsN6eq7I_wjV…