title: Can I use arrow function in constructor of a react component?
body: <p>This question is similar to <a href="https://stackoverflow.com/questions/41381720/when-using-react-is-it-preferable-to-use-fat-arrow-functions-or-bind-functions-i">When using React Is it preferable to use fat arrow functions or bind functions in constructor?</a> but a little bit different. You can bind a function to <code>this</code> in the constructor, or just apply arrow function in constructor. Note that I can only use ES6 syntax in my project.</p>
  
  <p>1.</p>
  
  <pre><code>class Test extends React.Component{
    constructor(props) {
      super(props);
  
      this.doSomeThing = this.doSomeThing.bind(this);
    }
  
    doSomething() {}
  }
  </code></pre>
  
  <p>2.</p>
  
  <pre><code>class Test extends React.Component{
    constructor(props) {
      super(props);
  
      this.doSomeThing = () =&gt; {};
    }
  }
  </code></pre>
  
  <p>What's the pros and cons of these two ways? Thanks.</p>