From f93829976588bdfb0b73da247a8f5cef862f832c Mon Sep 17 00:00:00 2001 From: Leland Richardson Date: Tue, 8 Mar 2016 18:51:06 -0800 Subject: [PATCH] [fix] key/ref warnings incorrectly throw on DOM Elements --- src/isomorphic/classic/element/ReactElement.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/isomorphic/classic/element/ReactElement.js b/src/isomorphic/classic/element/ReactElement.js index 379c81fc51..6e371596d0 100644 --- a/src/isomorphic/classic/element/ReactElement.js +++ b/src/isomorphic/classic/element/ReactElement.js @@ -184,7 +184,7 @@ ReactElement.createElement = function(type, config, children) { 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', - 'displayName' in type ? type.displayName: 'Element' + typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element' ); } return undefined; @@ -203,7 +203,7 @@ ReactElement.createElement = function(type, config, children) { 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://fb.me/react-special-props)', - 'displayName' in type ? type.displayName: 'Element' + typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element' ); } return undefined;