mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
* fix #11759. false positive warning in IE11 when using React.Fragment * simplify createElementWithValidation type check * fix mistake * Add an explanation * We shouldn't use `number` for anything else * Clarify further
This commit is contained in:
1 parent
abdbb16d4b
commit
a5025b1610
1 file changed
+4
-3
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user