React components have a lifecycle, and you are able to access specific phases of that lifecycle. This lesson will introduce mounting and unmounting of your React components.
In this case setProps and setState are interchangeable since there is only one component representing the entire example. This is seldom the case in a real world application. There are tests (http://jsperf.com/reactjs-setstate-vs-setprops ) that present setState as the faster option.
It is best to think of props as options or configuration that are sent to your component and state as internal or private variables. The ideal situation is to only have state in the Owner of a group of components. See: http://facebook.github.io/react/blog/2013/11/05/thinking-in-react.html
These specific methods are inherited from React.Component and executed automatically.
componentWillMount then render then componentDidMount.
componentWillMount and componentDidMount will never be called again.
componentWillUnmount is executed when the component is removed from the DOM.
Adding the component back to the DOM will restart the mounting lifecycle phases.