From 1ab7d49c2df5673dd214eb8a9b7fd3defb0ff857 Mon Sep 17 00:00:00 2001 From: Tim Yung Date: Mon, 7 May 2018 09:41:48 -0700 Subject: [PATCH] RN: Cleanup `__propTypesSecretDontUseThesePlease` Reviewed By: bvaughn Differential Revision: D7892903 fbshipit-source-id: aab0537fe508ac740d0a2798a04f54411c8c038d --- .../ReactNative/requireNativeComponent.js | 20 ++----------------- Libraries/ReactNative/verifyPropTypes.js | 9 +-------- 2 files changed, 3 insertions(+), 26 deletions(-) diff --git a/Libraries/ReactNative/requireNativeComponent.js b/Libraries/ReactNative/requireNativeComponent.js index 83a071c70..0e09ad9f8 100644 --- a/Libraries/ReactNative/requireNativeComponent.js +++ b/Libraries/ReactNative/requireNativeComponent.js @@ -108,24 +108,8 @@ function requireNativeComponent( viewConfig.uiViewClassName = viewName; viewConfig.validAttributes = {}; - - // 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 here by using - // temporary workaround, __propTypesSecretDontUseThesePlease. - // TODO (bvaughn) Revert this particular change any time after April 1 - if (componentInterface) { - viewConfig.propTypes = - /* $FlowFixMe(>=0.68.0 site=react_native_fb) This comment suppresses an - * error found when Flow v0.68 was deployed. To see the error delete - * this comment and run Flow. */ - typeof componentInterface.__propTypesSecretDontUseThesePlease === - 'object' - ? componentInterface.__propTypesSecretDontUseThesePlease - : componentInterface.propTypes; - } else { - viewConfig.propTypes = null; - } + viewConfig.propTypes = + componentInterface == null ? null : componentInterface.propTypes; let baseModuleName = viewConfig.baseModuleName; let bubblingEventTypes = viewConfig.bubblingEventTypes; diff --git a/Libraries/ReactNative/verifyPropTypes.js b/Libraries/ReactNative/verifyPropTypes.js index b7b04d013..c88f9c1c8 100644 --- a/Libraries/ReactNative/verifyPropTypes.js +++ b/Libraries/ReactNative/verifyPropTypes.js @@ -30,14 +30,7 @@ function verifyPropTypes( var componentName = componentInterface.displayName || componentInterface.name || 'unknown'; - // 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 here by using - // temporary workaround, __propTypesSecretDontUseThesePlease. - // TODO (bvaughn) Revert this particular change any time after April 1 - var propTypes = - (componentInterface: any).__propTypesSecretDontUseThesePlease || - componentInterface.propTypes; + var propTypes = componentInterface.propTypes; if (!propTypes) { return;