Remove View.propTypes RN deprecation workaround (#10683)

This commit is contained in:
Dan Abramov
2017-09-14 19:46:24 +01:00
committed by GitHub
parent 03443a2e23
commit c043c1e7d9
@@ -213,16 +213,7 @@ function validatePropTypes(element) {
return;
}
var name = componentClass.displayName || componentClass.name;
// ReactNative `View.propTypes` have been deprecated in favor of `ViewPropTypes`.
// In their place a temporary getter has been added with a deprecated warning message.
// Avoid triggering that warning during validation using the temporary workaround,
// __propTypesSecretDontUseThesePlease.
// TODO (bvaughn) Revert this particular change any time after April 1 ReactNative tag.
var propTypes = typeof componentClass.__propTypesSecretDontUseThesePlease ===
'object'
? componentClass.__propTypesSecretDontUseThesePlease
: componentClass.propTypes;
var propTypes = componentClass.propTypes;
if (propTypes) {
currentlyValidatingElement = element;