diff --git a/packages/react/src/ReactElementValidator.js b/packages/react/src/ReactElementValidator.js index 10b0723ca9fb5..cfa2afa00f3df 100644 --- a/packages/react/src/ReactElementValidator.js +++ b/packages/react/src/ReactElementValidator.js @@ -281,8 +281,9 @@ export function createElementWithValidation(type, props, children) { const validType = typeof type === 'string' || typeof type === 'function' || - typeof type === 'symbol' || - typeof type === 'number'; + // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. + type === REACT_FRAGMENT_TYPE; + // We warn in this case but don't throw. We expect the element creation to // succeed and there will likely be errors in render. if (!validType) { @@ -336,7 +337,7 @@ export function createElementWithValidation(type, props, children) { } } - if (typeof type === 'symbol' && type === REACT_FRAGMENT_TYPE) { + if (type === REACT_FRAGMENT_TYPE) { validateFragmentProps(element); } else { validatePropTypes(element);