|
7 | 7 | * @noflow |
8 | 8 | * @nolint |
9 | 9 | * @preventMunge |
10 | | - * @generated SignedSource<<20a889fc4c8eaee85875c7091bc5ea65>> |
| 10 | + * @generated SignedSource<<a9c49bc89f61d32aa1bc5a10d3664a01>> |
11 | 11 | */ |
12 | 12 |
|
13 | 13 | "use strict"; |
@@ -443,111 +443,6 @@ if (__DEV__) { |
443 | 443 | return ""; |
444 | 444 | } |
445 | 445 |
|
446 | | - var loggedTypeFailures = {}; |
447 | | - var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame; |
448 | | - |
449 | | - function setCurrentlyValidatingElement$1(element) { |
450 | | - { |
451 | | - if (element) { |
452 | | - var owner = element._owner; |
453 | | - var stack = describeUnknownElementTypeFrameInDEV( |
454 | | - element.type, |
455 | | - owner ? owner.type : null |
456 | | - ); |
457 | | - ReactDebugCurrentFrame$1.setExtraStackFrame(stack); |
458 | | - } else { |
459 | | - ReactDebugCurrentFrame$1.setExtraStackFrame(null); |
460 | | - } |
461 | | - } |
462 | | - } |
463 | | - |
464 | | - function checkPropTypes( |
465 | | - typeSpecs, |
466 | | - values, |
467 | | - location, |
468 | | - componentName, |
469 | | - element |
470 | | - ) { |
471 | | - { |
472 | | - // $FlowFixMe[incompatible-use] This is okay but Flow doesn't know it. |
473 | | - var has = Function.call.bind(hasOwnProperty); |
474 | | - |
475 | | - for (var typeSpecName in typeSpecs) { |
476 | | - if (has(typeSpecs, typeSpecName)) { |
477 | | - var error$1 = void 0; // Prop type validation may throw. In case they do, we don't want to |
478 | | - // fail the render phase where it didn't fail before. So we log it. |
479 | | - // After these have been cleaned up, we'll let them throw. |
480 | | - |
481 | | - try { |
482 | | - // This is intentionally an invariant that gets caught. It's the same |
483 | | - // behavior as without this statement except with a better message. |
484 | | - if (typeof typeSpecs[typeSpecName] !== "function") { |
485 | | - // eslint-disable-next-line react-internal/prod-error-codes |
486 | | - var err = Error( |
487 | | - (componentName || "React class") + |
488 | | - ": " + |
489 | | - location + |
490 | | - " type `" + |
491 | | - typeSpecName + |
492 | | - "` is invalid; " + |
493 | | - "it must be a function, usually from the `prop-types` package, but received `" + |
494 | | - typeof typeSpecs[typeSpecName] + |
495 | | - "`." + |
496 | | - "This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`." |
497 | | - ); |
498 | | - err.name = "Invariant Violation"; |
499 | | - throw err; |
500 | | - } |
501 | | - |
502 | | - error$1 = typeSpecs[typeSpecName]( |
503 | | - values, |
504 | | - typeSpecName, |
505 | | - componentName, |
506 | | - location, |
507 | | - null, |
508 | | - "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED" |
509 | | - ); |
510 | | - } catch (ex) { |
511 | | - error$1 = ex; |
512 | | - } |
513 | | - |
514 | | - if (error$1 && !(error$1 instanceof Error)) { |
515 | | - setCurrentlyValidatingElement$1(element); |
516 | | - |
517 | | - error( |
518 | | - "%s: type specification of %s" + |
519 | | - " `%s` is invalid; the type checker " + |
520 | | - "function must return `null` or an `Error` but returned a %s. " + |
521 | | - "You may have forgotten to pass an argument to the type checker " + |
522 | | - "creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and " + |
523 | | - "shape all require an argument).", |
524 | | - componentName || "React class", |
525 | | - location, |
526 | | - typeSpecName, |
527 | | - typeof error$1 |
528 | | - ); |
529 | | - |
530 | | - setCurrentlyValidatingElement$1(null); |
531 | | - } |
532 | | - |
533 | | - if ( |
534 | | - error$1 instanceof Error && |
535 | | - !(error$1.message in loggedTypeFailures) |
536 | | - ) { |
537 | | - // Only monitor this failure once because there tends to be a lot of the |
538 | | - // same error. |
539 | | - loggedTypeFailures[error$1.message] = true; |
540 | | - setCurrentlyValidatingElement$1(element); |
541 | | - |
542 | | - error("Failed %s type: %s", location, error$1.message); |
543 | | - |
544 | | - setCurrentlyValidatingElement$1(null); |
545 | | - } |
546 | | - } |
547 | | - } |
548 | | - } |
549 | | - } |
550 | | - |
551 | 446 | var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner; |
552 | 447 | var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame; |
553 | 448 | var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"); |
@@ -950,8 +845,6 @@ if (__DEV__) { |
950 | 845 |
|
951 | 846 | if (type === REACT_FRAGMENT_TYPE) { |
952 | 847 | validateFragmentProps(element); |
953 | | - } else { |
954 | | - validatePropTypes(element); |
955 | 848 | } |
956 | 849 |
|
957 | 850 | return element; |
@@ -1178,71 +1071,6 @@ if (__DEV__) { |
1178 | 1071 | } |
1179 | 1072 | } |
1180 | 1073 |
|
1181 | | - var propTypesMisspellWarningShown = false; |
1182 | | - /** |
1183 | | - * Given an element, validate that its props follow the propTypes definition, |
1184 | | - * provided by the type. |
1185 | | - * |
1186 | | - * @param {ReactElement} element |
1187 | | - */ |
1188 | | - |
1189 | | - function validatePropTypes(element) { |
1190 | | - { |
1191 | | - var type = element.type; |
1192 | | - |
1193 | | - if (type === null || type === undefined || typeof type === "string") { |
1194 | | - return; |
1195 | | - } |
1196 | | - |
1197 | | - if (type.$$typeof === REACT_CLIENT_REFERENCE) { |
1198 | | - return; |
1199 | | - } |
1200 | | - |
1201 | | - var propTypes; |
1202 | | - |
1203 | | - if (typeof type === "function") { |
1204 | | - propTypes = type.propTypes; |
1205 | | - } else if ( |
1206 | | - typeof type === "object" && |
1207 | | - (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here. |
1208 | | - // Inner props are checked in the reconciler. |
1209 | | - type.$$typeof === REACT_MEMO_TYPE) |
1210 | | - ) { |
1211 | | - propTypes = type.propTypes; |
1212 | | - } else { |
1213 | | - return; |
1214 | | - } |
1215 | | - |
1216 | | - if (propTypes) { |
1217 | | - // Intentionally inside to avoid triggering lazy initializers: |
1218 | | - var name = getComponentNameFromType(type); |
1219 | | - checkPropTypes(propTypes, element.props, "prop", name, element); |
1220 | | - } else if ( |
1221 | | - type.PropTypes !== undefined && |
1222 | | - !propTypesMisspellWarningShown |
1223 | | - ) { |
1224 | | - propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers: |
1225 | | - |
1226 | | - var _name = getComponentNameFromType(type); |
1227 | | - |
1228 | | - error( |
1229 | | - "Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", |
1230 | | - _name || "Unknown" |
1231 | | - ); |
1232 | | - } |
1233 | | - |
1234 | | - if ( |
1235 | | - typeof type.getDefaultProps === "function" && |
1236 | | - !type.getDefaultProps.isReactClassApproved |
1237 | | - ) { |
1238 | | - error( |
1239 | | - "getDefaultProps is only used on classic React.createClass " + |
1240 | | - "definitions. Use a static property named `defaultProps` instead." |
1241 | | - ); |
1242 | | - } |
1243 | | - } |
1244 | | - } |
1245 | | - |
1246 | 1074 | var jsxDEV = jsxDEV$1; |
1247 | 1075 |
|
1248 | 1076 | exports.Fragment = REACT_FRAGMENT_TYPE; |
|
0 commit comments