title: Cannot Override A Method In React
body: <p>I have two components:</p>
  
  <pre><code>var A = React.createClass( {
  
     doSomething: function() { return "I am A" },
  
      render() {
      return(
          &lt;h1&gt;{this.doSomething()}&lt;/h1&gt;
        );    
     }
      });
  
  class B extends A {
     doSomething(): any {
       console.log("I am B");
     } 
  }
  </code></pre>
  
  <p><a href="https://jsfiddle.net/wp4wshdu/" rel="nofollow noreferrer">https://jsfiddle.net/wp4wshdu/</a></p>
  
  <p>I have the same problem as here => <a href="https://stackoverflow.com/questions/38758518/how-to-override-a-parent-class-method-in-react">How to override a parent class method in React?</a> And it seems to be due to the fact that only component B defined in the EC-6 style. My problem is that I cannot change A class. How can I make React use the B's method in this case?</p>