@samitouri / QOS-React-2 / commits / f938299765

[fix] key/ref warnings incorrectly throw on DOM Elements

Leland Richardson committed Mar 8, 2016 at 18:51 UTC f93829976588bdfb0b73da247a8f5cef862f832c
1 file changed +2 -2
src/isomorphic/classic/element/ReactElement.js
+2 -2
@@ -184,7 +184,7 @@ ReactElement.createElement = function(type, config, children) {
184 'in `undefined` being returned. If you need to access the same ' +
185 'value within the child component, you should pass it as a different ' +
186 'prop. (https://fb.me/react-special-props)',
187 - 'displayName' in type ? type.displayName: 'Element'
187 + typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element'
188 );
189 }
190 return undefined;
@@ -203,7 +203,7 @@ ReactElement.createElement = function(type, config, children) {
203 'in `undefined` being returned. If you need to access the same ' +
204 'value within the child component, you should pass it as a different ' +
205 'prop. (https://fb.me/react-special-props)',
206 - 'displayName' in type ? type.displayName: 'Element'
206 + typeof type === 'function' && 'displayName' in type ? type.displayName : 'Element'
207 );
208 }
209 return undefined;