title: What is the purpose of having functions like componentWillMount in React.js?
body: <p>I have been writing components in React.js recently.  I have never had to use methods like <code>componentWillMount</code> and <code>componentDidMount</code>.</p>
  
  <p><code>render</code> is indispensable.  <code>getInitialState</code> and other helper methods I wrote also come in handy.  But not the two aforementioned lifecycle methods.</p>
  
  <p>My current guess is that they are used for debugging?  I can console.log out inside them: </p>
  
  <pre><code>componentWillMount: function() {
    console.log('component currently mounting');
  },
  
  componentDidMount: function() {
    console.log('component has mounted');
  } 
  </code></pre>
  
  <p>Are there any other uses?</p>