The first updating lifecycle method is called
When a component instance updates,
componentWillReceiveProps gets called before the rendering begins.
As one might expect,
componentWillReceiveProps only gets called if the component will receive
<Example prop="myVal" />,
Look in the code editor for an example of
componentWillReceiveProps. Read it through and try to figure out how it works.
componentWillReceiveProps automatically gets passed one argument: an object called
nextProps is a preview of the upcoming
props object that the component is about to receive.
On line 6,
nextProps.text will evaluate to