From 952fffeaed6c9beb66e26fc880fdfe8b751d4e24 Mon Sep 17 00:00:00 2001 From: Andrew Imm Date: Mon, 12 Jun 2017 15:59:06 -0700 Subject: [PATCH] Update remaining PropTypes references Reviewed By: bvaughn Differential Revision: D5231309 fbshipit-source-id: d54ee4f73dae63124f4462c138383447829a2551 --- Libraries/CameraRoll/CameraRoll.js | 3 ++- Libraries/Components/AppleTV/TVViewPropTypes.js | 2 +- Libraries/Components/Picker/PickerAndroid.android.js | 3 +-- Libraries/Components/View/ViewPropTypes.js | 2 +- Libraries/Components/View/ViewStylePropTypes.js | 4 ++-- Libraries/Experimental/SwipeableRow/SwipeableListView.js | 3 +-- Libraries/Image/ImageSourcePropType.js | 2 +- Libraries/Image/ImageStylePropTypes.js | 5 ++--- Libraries/StyleSheet/EdgeInsetsPropType.js | 2 +- Libraries/StyleSheet/LayoutPropTypes.js | 2 +- Libraries/StyleSheet/PointPropType.js | 2 +- Libraries/StyleSheet/TransformPropTypes.js | 4 ++-- Libraries/Text/TextStylePropTypes.js | 2 +- 13 files changed, 17 insertions(+), 19 deletions(-) diff --git a/Libraries/CameraRoll/CameraRoll.js b/Libraries/CameraRoll/CameraRoll.js index 7a07bfdc06a45a..e0ac8d361e7297 100644 --- a/Libraries/CameraRoll/CameraRoll.js +++ b/Libraries/CameraRoll/CameraRoll.js @@ -12,7 +12,8 @@ */ 'use strict'; -const {PropTypes, checkPropTypes} = require('React'); +const PropTypes = require('prop-types'); +const {checkPropTypes} = PropTypes; const RCTCameraRollManager = require('NativeModules').CameraRollManager; const createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); diff --git a/Libraries/Components/AppleTV/TVViewPropTypes.js b/Libraries/Components/AppleTV/TVViewPropTypes.js index 63b903c3eda1fe..d0ed6817a5b38e 100644 --- a/Libraries/Components/AppleTV/TVViewPropTypes.js +++ b/Libraries/Components/AppleTV/TVViewPropTypes.js @@ -10,7 +10,7 @@ * @flow */ 'use strict'; -var PropTypes = require('React').PropTypes; +var PropTypes = require('prop-types'); /** * Additional View properties for Apple TV diff --git a/Libraries/Components/Picker/PickerAndroid.android.js b/Libraries/Components/Picker/PickerAndroid.android.js index 511b4d3194625c..03f729709a34c4 100644 --- a/Libraries/Components/Picker/PickerAndroid.android.js +++ b/Libraries/Components/Picker/PickerAndroid.android.js @@ -14,6 +14,7 @@ var ColorPropType = require('ColorPropType'); var React = require('React'); +var ReactPropTypes = require('prop-types'); var StyleSheet = require('StyleSheet'); var StyleSheetPropType = require('StyleSheetPropType'); const ViewPropTypes = require('ViewPropTypes'); @@ -22,8 +23,6 @@ var ViewStylePropTypes = require('ViewStylePropTypes'); var processColor = require('processColor'); var requireNativeComponent = require('requireNativeComponent'); -var ReactPropTypes = React.PropTypes; - var REF_PICKER = 'picker'; var MODE_DROPDOWN = 'dropdown'; diff --git a/Libraries/Components/View/ViewPropTypes.js b/Libraries/Components/View/ViewPropTypes.js index a0f8b8ff5f7208..c8d0faa219acc7 100644 --- a/Libraries/Components/View/ViewPropTypes.js +++ b/Libraries/Components/View/ViewPropTypes.js @@ -13,10 +13,10 @@ const EdgeInsetsPropType = require('EdgeInsetsPropType'); const Platform = require('Platform'); +const PropTypes = require('prop-types'); const StyleSheetPropType = require('StyleSheetPropType'); const ViewStylePropTypes = require('ViewStylePropTypes'); -const { PropTypes } = require('React'); const { AccessibilityComponentTypes, AccessibilityTraits, diff --git a/Libraries/Components/View/ViewStylePropTypes.js b/Libraries/Components/View/ViewStylePropTypes.js index dcd6c1c5422897..49fff29d81883d 100644 --- a/Libraries/Components/View/ViewStylePropTypes.js +++ b/Libraries/Components/View/ViewStylePropTypes.js @@ -11,9 +11,9 @@ */ 'use strict'; -var LayoutPropTypes = require('LayoutPropTypes'); -var ReactPropTypes = require('React').PropTypes; var ColorPropType = require('ColorPropType'); +var LayoutPropTypes = require('LayoutPropTypes'); +var ReactPropTypes = require('prop-types'); var ShadowPropTypesIOS = require('ShadowPropTypesIOS'); var TransformPropTypes = require('TransformPropTypes'); diff --git a/Libraries/Experimental/SwipeableRow/SwipeableListView.js b/Libraries/Experimental/SwipeableRow/SwipeableListView.js index 95381044771544..a872600ccef13c 100644 --- a/Libraries/Experimental/SwipeableRow/SwipeableListView.js +++ b/Libraries/Experimental/SwipeableRow/SwipeableListView.js @@ -12,12 +12,11 @@ 'use strict'; const ListView = require('ListView'); +const PropTypes = require('prop-types'); const React = require('React'); const SwipeableListViewDataSource = require('SwipeableListViewDataSource'); const SwipeableRow = require('SwipeableRow'); -const {PropTypes} = React; - type DefaultProps = { bounceFirstRowOnMount: boolean, renderQuickActions: Function, diff --git a/Libraries/Image/ImageSourcePropType.js b/Libraries/Image/ImageSourcePropType.js index 4c7b3a7c90f3ef..eb21de802c69f3 100644 --- a/Libraries/Image/ImageSourcePropType.js +++ b/Libraries/Image/ImageSourcePropType.js @@ -11,7 +11,7 @@ */ 'use strict'; -const {PropTypes} = require('React'); +const PropTypes = require('prop-types'); const ImageURISourcePropType = PropTypes.shape({ /** diff --git a/Libraries/Image/ImageStylePropTypes.js b/Libraries/Image/ImageStylePropTypes.js index 9bb68402424fec..70f21d32d3fbce 100644 --- a/Libraries/Image/ImageStylePropTypes.js +++ b/Libraries/Image/ImageStylePropTypes.js @@ -11,14 +11,13 @@ */ 'use strict'; +var ColorPropType = require('ColorPropType'); var ImageResizeMode = require('ImageResizeMode'); var LayoutPropTypes = require('LayoutPropTypes'); -var ColorPropType = require('ColorPropType'); +var ReactPropTypes = require('prop-types'); var ShadowPropTypesIOS = require('ShadowPropTypesIOS'); var TransformPropTypes = require('TransformPropTypes'); -var ReactPropTypes = require('React').PropTypes; - var ImageStylePropTypes = { ...LayoutPropTypes, ...ShadowPropTypesIOS, diff --git a/Libraries/StyleSheet/EdgeInsetsPropType.js b/Libraries/StyleSheet/EdgeInsetsPropType.js index b911febd7fb8f8..0514939226ec83 100644 --- a/Libraries/StyleSheet/EdgeInsetsPropType.js +++ b/Libraries/StyleSheet/EdgeInsetsPropType.js @@ -11,7 +11,7 @@ */ 'use strict'; -var {PropTypes} = require('React'); +var PropTypes = require('prop-types'); var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); diff --git a/Libraries/StyleSheet/LayoutPropTypes.js b/Libraries/StyleSheet/LayoutPropTypes.js index 56e42a5af5c912..ac9b239b1d3f1c 100644 --- a/Libraries/StyleSheet/LayoutPropTypes.js +++ b/Libraries/StyleSheet/LayoutPropTypes.js @@ -11,7 +11,7 @@ */ 'use strict'; -var ReactPropTypes = require('React').PropTypes; +var ReactPropTypes = require('prop-types'); /** * React Native's layout system is based on Flexbox and is powered both diff --git a/Libraries/StyleSheet/PointPropType.js b/Libraries/StyleSheet/PointPropType.js index 5393bf10e6b8e2..7257e365dd97d0 100644 --- a/Libraries/StyleSheet/PointPropType.js +++ b/Libraries/StyleSheet/PointPropType.js @@ -11,7 +11,7 @@ */ 'use strict'; -var PropTypes = require('React').PropTypes; +var PropTypes = require('prop-types'); var createStrictShapeTypeChecker = require('createStrictShapeTypeChecker'); diff --git a/Libraries/StyleSheet/TransformPropTypes.js b/Libraries/StyleSheet/TransformPropTypes.js index 884dfaa30bb759..ae975a6f2f8fcf 100644 --- a/Libraries/StyleSheet/TransformPropTypes.js +++ b/Libraries/StyleSheet/TransformPropTypes.js @@ -11,9 +11,9 @@ */ 'use strict'; -var deprecatedPropType = require('deprecatedPropType'); +var ReactPropTypes = require('prop-types'); -var ReactPropTypes = require('React').PropTypes; +var deprecatedPropType = require('deprecatedPropType'); var TransformMatrixPropType = function( props : Object, diff --git a/Libraries/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js index 4c84de66dab394..d92708683d981e 100644 --- a/Libraries/Text/TextStylePropTypes.js +++ b/Libraries/Text/TextStylePropTypes.js @@ -11,8 +11,8 @@ */ 'use strict'; -const ReactPropTypes = require('React').PropTypes; const ColorPropType = require('ColorPropType'); +const ReactPropTypes = require('prop-types'); const ViewStylePropTypes = require('ViewStylePropTypes'); const TextStylePropTypes = {