title: How should I alternate componentWillMount()?
body: <p>I'm using React.js, and as you know, componentWillMount() is going to be deprecated.
  I wanna replace my <code>componentWillMount</code>s.</p>
  
  <p>I'm going to move its logics into <code>constructor</code>. Is there any difference between executing some logic in <code>componentWillMount</code> and in <code>constructor</code>?</p>
  
  <p>For example,</p>
  
  <p>before</p>
  
  <pre><code>class Hello extends React.Component {
      componentWillMount() {
        doSomething();
      }
  
    render() {
      return &lt;div&gt;{this.state.name} &lt;/div&gt;
    }
  }
  </code></pre>
  
  <p>after</p>
  
  <pre><code>class Hello extends React.Component {
      constructor(props) {
        super(props);
  
        doSomething();
      }
  
    render() {
      return &lt;div&gt;{this.state.name} &lt;/div&gt;
    }
  }
  </code></pre>
  
  <p>Also, when doSomething is setState, is there any difference setting state in constructor and in public prop?</p>
  
  <p>in constructor</p>
  
  <pre><code>constructor(props) {
    super(props);
  
    this.state = { foo: 1 };
  }
  </code></pre>
  
  <p>in public prop</p>
  
  <pre><code>state = { foo: 1 };
  </code></pre>