I have two components:
var A = React.createClass( {
doSomething: function() { return "I am A" },
render() {
return(
<h1>{this.doSomething()}</h1>
);
}
});
class B extends A {
doSomething(): any {
console.log("I am B");
}
}
https://jsfiddle.net/wp4wshdu/
I have the same problem as here => How to override a parent class method in React? 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?