mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Check if a function has a prototype first
Because somehow someone used a prototype less function with JSX.
This commit is contained in:
committed by
Paul O’Shannessy
parent
68b7b82145
commit
5c51f2fe46
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user