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..a21463683dee47 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'; @@ -53,7 +52,7 @@ class PickerAndroid extends React.Component { static propTypes = { ...ViewPropTypes, style: pickerStyleType, - selectedValue: React.PropTypes.any, + selectedValue: ReactPropTypes.any, enabled: ReactPropTypes.bool, mode: ReactPropTypes.oneOf(['dialog', 'dropdown']), onValueChange: ReactPropTypes.func, diff --git a/Libraries/Components/View/ShadowPropTypesIOS.js b/Libraries/Components/View/ShadowPropTypesIOS.js index 2a026ced7c064a..7081803b5fbc6f 100644 --- a/Libraries/Components/View/ShadowPropTypesIOS.js +++ b/Libraries/Components/View/ShadowPropTypesIOS.js @@ -12,7 +12,7 @@ 'use strict'; var ColorPropType = require('ColorPropType'); -var ReactPropTypes = require('React').PropTypes; +var ReactPropTypes = require('prop-types'); var ShadowPropTypesIOS = { /** diff --git a/Libraries/Components/View/ViewStylePropTypes.js b/Libraries/Components/View/ViewStylePropTypes.js index dcd6c1c5422897..4ebe175829b62f 100644 --- a/Libraries/Components/View/ViewStylePropTypes.js +++ b/Libraries/Components/View/ViewStylePropTypes.js @@ -12,7 +12,7 @@ 'use strict'; var LayoutPropTypes = require('LayoutPropTypes'); -var ReactPropTypes = require('React').PropTypes; +var ReactPropTypes = require('prop-types'); var ColorPropType = require('ColorPropType'); var ShadowPropTypesIOS = require('ShadowPropTypesIOS'); var TransformPropTypes = require('TransformPropTypes'); diff --git a/Libraries/Image/ImageStylePropTypes.js b/Libraries/Image/ImageStylePropTypes.js index 9bb68402424fec..ac9e28089b3b17 100644 --- a/Libraries/Image/ImageStylePropTypes.js +++ b/Libraries/Image/ImageStylePropTypes.js @@ -14,10 +14,10 @@ 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, diff --git a/Libraries/ReactNative/AppContainer.js b/Libraries/ReactNative/AppContainer.js index 68a88ffe6675dc..ac6d52fd01bf11 100644 --- a/Libraries/ReactNative/AppContainer.js +++ b/Libraries/ReactNative/AppContainer.js @@ -13,6 +13,7 @@ 'use strict'; const EmitterSubscription = require('EmitterSubscription'); +const PropTypes = require('prop-types'); const RCTDeviceEventEmitter = require('RCTDeviceEventEmitter'); const React = require('React'); const ReactNative = require('ReactNative'); @@ -41,7 +42,7 @@ class AppContainer extends React.Component { _subscription: ?EmitterSubscription = null; static childContextTypes = { - rootTag: React.PropTypes.number, + rootTag: PropTypes.number, }; getChildContext(): Context { 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..d142f90048f6e4 100644 --- a/Libraries/StyleSheet/TransformPropTypes.js +++ b/Libraries/StyleSheet/TransformPropTypes.js @@ -13,7 +13,7 @@ var deprecatedPropType = require('deprecatedPropType'); -var ReactPropTypes = require('React').PropTypes; +var ReactPropTypes = require('prop-types'); var TransformMatrixPropType = function( props : Object, diff --git a/Libraries/Text/TextStylePropTypes.js b/Libraries/Text/TextStylePropTypes.js index 4c84de66dab394..6a90217caa5721 100644 --- a/Libraries/Text/TextStylePropTypes.js +++ b/Libraries/Text/TextStylePropTypes.js @@ -11,7 +11,7 @@ */ 'use strict'; -const ReactPropTypes = require('React').PropTypes; +const ReactPropTypes = require('prop-types'); const ColorPropType = require('ColorPropType'); const ViewStylePropTypes = require('ViewStylePropTypes'); diff --git a/docs/NativeComponentsAndroid.md b/docs/NativeComponentsAndroid.md index c32622d44ffe19..39eca1cc4c60fe 100644 --- a/docs/NativeComponentsAndroid.md +++ b/docs/NativeComponentsAndroid.md @@ -107,7 +107,7 @@ The very final step is to create the JavaScript module that defines the interfac ```js // ImageView.js -import { PropTypes } from 'react'; +import PropTypes from 'prop-types'; import { requireNativeComponent, View } from 'react-native'; var iface = { @@ -168,7 +168,7 @@ MyCustomView.propTypes = { /** * Callback that is called continuously when the user is dragging the map. */ - onChangeMessage: React.PropTypes.func, + onChangeMessage: PropTypes.func, ... }; diff --git a/docs/NativeComponentsIOS.md b/docs/NativeComponentsIOS.md index 5f1f02d71d0ec3..cbf3d7f8193279 100644 --- a/docs/NativeComponentsIOS.md +++ b/docs/NativeComponentsIOS.md @@ -84,6 +84,7 @@ This isn't very well documented though - in order to know what properties are av ```javascript // MapView.js +import PropTypes from 'prop-types'; import React from 'react'; import { requireNativeComponent } from 'react-native'; @@ -101,7 +102,7 @@ MapView.propTypes = { * angle is ignored and the map is always displayed as if the user * is looking straight down onto it. */ - pitchEnabled: React.PropTypes.bool, + pitchEnabled: PropTypes.bool, }; var RNTMap = requireNativeComponent('RNTMap', MapView); @@ -177,7 +178,7 @@ MapView.propTypes = { * angle is ignored and the map is always displayed as if the user * is looking straight down onto it. */ - pitchEnabled: React.PropTypes.bool, + pitchEnabled: PropTypes.bool, /** * The region to be displayed by the map. @@ -185,19 +186,19 @@ MapView.propTypes = { * The region is defined by the center coordinates and the span of * coordinates to display. */ - region: React.PropTypes.shape({ + region: PropTypes.shape({ /** * Coordinates for the center of the map. */ - latitude: React.PropTypes.number.isRequired, - longitude: React.PropTypes.number.isRequired, + latitude: PropTypes.number.isRequired, + longitude: PropTypes.number.isRequired, /** * Distance between the minimum and the maximum latitude/longitude * to be displayed. */ - latitudeDelta: React.PropTypes.number.isRequired, - longitudeDelta: React.PropTypes.number.isRequired, + latitudeDelta: PropTypes.number.isRequired, + longitudeDelta: PropTypes.number.isRequired, }), }; @@ -323,7 +324,7 @@ MapView.propTypes = { /** * Callback that is called continuously when the user is dragging the map. */ - onChange: React.PropTypes.func, + onChange: PropTypes.func, ... };