diff --git a/src/isomorphic/classic/element/ReactElement.js b/src/isomorphic/classic/element/ReactElement.js index 49d94b210c..39db3d2a6b 100644 --- a/src/isomorphic/classic/element/ReactElement.js +++ b/src/isomorphic/classic/element/ReactElement.js @@ -17,7 +17,7 @@ var assign = require('Object.assign'); // The Symbol used to tag the ReactElement type. If there is no native Symbol // nor polyfill, then a plain number is used for performance. -var TYPE_SYMBOL = +var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && Symbol.for && Symbol.for('react.element')) || 0xeac7; @@ -59,7 +59,7 @@ if (__DEV__) { var ReactElement = function(type, key, ref, self, source, owner, props) { var element = { // This tag allow us to uniquely identify this as a React Element - $$typeof: TYPE_SYMBOL, + $$typeof: REACT_ELEMENT_TYPE, // Built-in properties that belong on the element type: type, @@ -289,7 +289,7 @@ ReactElement.isValidElement = function(object) { return ( typeof object === 'object' && object !== null && - object.$$typeof === TYPE_SYMBOL + object.$$typeof === REACT_ELEMENT_TYPE ); }; diff --git a/src/isomorphic/classic/element/__tests__/ReactElement-test.js b/src/isomorphic/classic/element/__tests__/ReactElement-test.js index d93aa2eee5..78e70c3e8e 100644 --- a/src/isomorphic/classic/element/__tests__/ReactElement-test.js +++ b/src/isomorphic/classic/element/__tests__/ReactElement-test.js @@ -327,14 +327,14 @@ describe('ReactElement', function() { // Rudimentary polyfill // Once all jest engines support Symbols natively we can swap this to test // WITH native Symbols by default. - var TYPE_SYMBOL = function() {}; // fake Symbol + var REACT_ELEMENT_TYPE = function() {}; // fake Symbol var OTHER_SYMBOL = function() {}; // another fake Symbol global.Symbol = function(name) { return OTHER_SYMBOL; }; global.Symbol.for = function(key) { if (key === 'react.element') { - return TYPE_SYMBOL; + return REACT_ELEMENT_TYPE; } return OTHER_SYMBOL; };