Class Names
Firstly, if you're certain that you're extending from the correctly named class, e.g. React.Component, not React.component or React.createComponent, you may need to upgrade your React version. See answers below for more information on the classes to extend from.
Upgrade React
React has only supported ES6-style classes since version 0.13.0 (see their official blog post on the support introduction here.
Before that, when using:
class HelloMessage extends React.Component
you were attempting to use ES6 keywords (extends
) to subclass from a class which wasn't defined using ES6 class
. This was likely why you were running into strange behaviour with super
definitions etc.
So, yes, TL;DR - update to React v0.13.x.
Circular Dependencies
This can also occur if you have circular import structure. One module importing another and the other way around. In this case you just need to refactor your code to avoid it. More info
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…