13
13
14
14
var ReactElement = require ( 'ReactElement' ) ;
15
15
var ReactPropTypeLocationNames = require ( 'ReactPropTypeLocationNames' ) ;
16
- var ReactPropTypesSecret = require ( 'ReactPropTypesSecret' ) ;
17
16
18
17
var emptyFunction = require ( 'emptyFunction' ) ;
19
18
var getIteratorFn = require ( 'getIteratorFn' ) ;
@@ -153,42 +152,16 @@ function PropTypeError(message) {
153
152
PropTypeError . prototype = Error . prototype ;
154
153
155
154
function createChainableTypeChecker ( validate ) {
156
- if ( __DEV__ ) {
157
- var manualPropTypeCallCache = { } ;
158
- }
159
155
function checkType (
160
156
isRequired ,
161
157
props ,
162
158
propName ,
163
159
componentName ,
164
160
location ,
165
- propFullName ,
166
- secret
161
+ propFullName
167
162
) {
168
163
componentName = componentName || ANONYMOUS ;
169
164
propFullName = propFullName || propName ;
170
- if ( __DEV__ ) {
171
- if (
172
- secret !== ReactPropTypesSecret &&
173
- typeof console !== 'undefined'
174
- ) {
175
- var cacheKey = `${ componentName } :${ propName } ` ;
176
- if ( ! manualPropTypeCallCache [ cacheKey ] ) {
177
- warning (
178
- false ,
179
- 'You are manually calling a React.PropTypes validation ' +
180
- 'function for the `%s` prop on `%s`. This is deprecated ' +
181
- 'and will not work in production with the next major version. ' +
182
- 'You may be seeing this warning due to a third-party PropTypes ' +
183
- 'library. See https://fb.me/react-warning-dont-call-proptypes ' +
184
- 'for details.' ,
185
- propFullName ,
186
- componentName
187
- ) ;
188
- manualPropTypeCallCache [ cacheKey ] = true ;
189
- }
190
- }
191
- }
192
165
if ( props [ propName ] == null ) {
193
166
var locationName = ReactPropTypeLocationNames [ location ] ;
194
167
if ( isRequired ) {
@@ -205,13 +178,7 @@ function createChainableTypeChecker(validate) {
205
178
}
206
179
return null ;
207
180
} else {
208
- return validate (
209
- props ,
210
- propName ,
211
- componentName ,
212
- location ,
213
- propFullName ,
214
- ) ;
181
+ return validate ( props , propName , componentName , location , propFullName ) ;
215
182
}
216
183
}
217
184
@@ -222,14 +189,7 @@ function createChainableTypeChecker(validate) {
222
189
}
223
190
224
191
function createPrimitiveTypeChecker ( expectedType ) {
225
- function validate (
226
- props ,
227
- propName ,
228
- componentName ,
229
- location ,
230
- propFullName ,
231
- secret
232
- ) {
192
+ function validate ( props , propName , componentName , location , propFullName ) {
233
193
var propValue = props [ propName ] ;
234
194
var propType = getPropType ( propValue ) ;
235
195
if ( propType !== expectedType ) {
@@ -276,8 +236,7 @@ function createArrayOfTypeChecker(typeChecker) {
276
236
i ,
277
237
componentName ,
278
238
location ,
279
- `${ propFullName } [${ i } ]` ,
280
- ReactPropTypesSecret
239
+ `${ propFullName } [${ i } ]`
281
240
) ;
282
241
if ( error instanceof Error ) {
283
242
return error ;
@@ -368,8 +327,7 @@ function createObjectOfTypeChecker(typeChecker) {
368
327
key ,
369
328
componentName ,
370
329
location ,
371
- `${ propFullName } .${ key } ` ,
372
- ReactPropTypesSecret
330
+ `${ propFullName } .${ key } `
373
331
) ;
374
332
if ( error instanceof Error ) {
375
333
return error ;
@@ -391,14 +349,7 @@ function createUnionTypeChecker(arrayOfTypeCheckers) {
391
349
for ( var i = 0 ; i < arrayOfTypeCheckers . length ; i ++ ) {
392
350
var checker = arrayOfTypeCheckers [ i ] ;
393
351
if (
394
- checker (
395
- props ,
396
- propName ,
397
- componentName ,
398
- location ,
399
- propFullName ,
400
- ReactPropTypesSecret
401
- ) == null
352
+ checker ( props , propName , componentName , location , propFullName ) == null
402
353
) {
403
354
return null ;
404
355
}
@@ -448,8 +399,7 @@ function createShapeTypeChecker(shapeTypes) {
448
399
key ,
449
400
componentName ,
450
401
location ,
451
- `${ propFullName } .${ key } ` ,
452
- ReactPropTypesSecret
402
+ `${ propFullName } .${ key } `
453
403
) ;
454
404
if ( error ) {
455
405
return error ;
0 commit comments