Check if a function has a prototype first

Because somehow someone used a prototype less function with JSX.
This commit is contained in:
Sebastian Markbage
2014-08-20 00:15:32 -07:00
committed by Paul O’Shannessy
parent 68b7b82145
commit 5c51f2fe46
+1
View File
@@ -49,6 +49,7 @@ function warnForLegacyFactoryCall() {
function warnForPlainFunctionType(type) {
var isReactClass =
type.prototype &&
typeof type.prototype.mountComponent === 'function' &&
typeof type.prototype.receiveComponent === 'function';
if (isReactClass) {