Skip to content

Commit

Permalink
RN: Cleanup __propTypesSecretDontUseThesePlease
Browse files Browse the repository at this point in the history
Reviewed By: bvaughn

Differential Revision: D7892903

fbshipit-source-id: aab0537fe508ac740d0a2798a04f54411c8c038d
  • Loading branch information
yungsters authored and facebook-github-bot committed May 7, 2018
1 parent 23f8f7a commit 1ab7d49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
20 changes: 2 additions & 18 deletions Libraries/ReactNative/requireNativeComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
9 changes: 1 addition & 8 deletions Libraries/ReactNative/verifyPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1ab7d49

Please sign in to comment.