From 5c51f2fe4612bd2499f830382dafebac85a661d3 Mon Sep 17 00:00:00 2001 From: Sebastian Markbage Date: Tue, 19 Aug 2014 23:16:53 -0700 Subject: [PATCH] Check if a function has a prototype first Because somehow someone used a prototype less function with JSX. --- src/core/ReactLegacyDescriptor.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/ReactLegacyDescriptor.js b/src/core/ReactLegacyDescriptor.js index ff882723b4..b4ce4883b3 100644 --- a/src/core/ReactLegacyDescriptor.js +++ b/src/core/ReactLegacyDescriptor.js @@ -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) {