You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2024. It is now read-only.
// This is intentionally an invariant that gets caught. It's the same
38
51
// behavior as without this statement except with a better message.
39
-
invariant(typeoftypeSpecs[typeSpecName]==='function','%s: %s type `%s` is invalid; it must be a function, usually from '+'the `prop-types` package, but received `%s`.',componentName||'React class',location,typeSpecName,typeoftypeSpecs[typeSpecName]);
52
+
if(typeoftypeSpecs[typeSpecName]!=='function'){
53
+
thrownewError(
54
+
(componentName||'React class')+': '+location+' type `'+typeSpecName+'` is invalid; '+
55
+
'it must be a function, usually from the `prop-types` package, but received `'+typeoftypeSpecs[typeSpecName]+'`.'
warning(!error||errorinstanceofError,'%s: type specification of %s `%s` is invalid; the type checker '+'function must return `null` or an `Error` but returned a %s. '+'You may have forgotten to pass an argument to the type checker '+'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+'shape all require an argument).',componentName||'React class',location,typeSpecName,typeoferror);
62
+
if(error&&!(errorinstanceofError)){
63
+
printWarning(
64
+
(componentName||'React class')+': type specification of '+
65
+
location+' `'+typeSpecName+'` is invalid; the type checker '+
66
+
'function must return `null` or an `Error` but returned a '+typeoferror+'. '+
67
+
'You may have forgotten to pass an argument to the type checker '+
68
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and '+
0 commit comments