From dd09c88571f5397346903e0e8c73224cbf40c862 Mon Sep 17 00:00:00 2001 From: Krzysztof Magiera Date: Wed, 18 Nov 2015 11:34:05 -0800 Subject: [PATCH] Compose propTypes from View.propTypes where appropriate. Reviewed By: davidaurelio Differential Revision: D2668380 fb-gh-sync-id: f34fc8df3bbf755c710e99c5421762406afaba2c --- .../Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js | 1 + Libraries/Components/DatePicker/DatePickerIOS.ios.js | 1 + Libraries/Components/MapView/MapView.js | 1 + .../Components/ProgressBarAndroid/ProgressBarAndroid.android.js | 2 ++ Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js | 2 ++ .../Components/SegmentedControlIOS/SegmentedControlIOS.ios.js | 2 ++ Libraries/Components/SliderIOS/SliderIOS.ios.js | 1 + Libraries/Components/SwitchIOS/SwitchIOS.ios.js | 2 ++ Libraries/Components/TabBarIOS/TabBarIOS.ios.js | 1 + Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js | 1 + Libraries/Components/WebView/WebView.ios.js | 1 + Libraries/Picker/PickerIOS.ios.js | 1 + Libraries/RCTTest/SnapshotViewIOS.ios.js | 1 + 13 files changed, 17 insertions(+) diff --git a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js index ed1744a1c..fa97eb83a 100644 --- a/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js +++ b/Libraries/Components/ActivityIndicatorIOS/ActivityIndicatorIOS.ios.js @@ -32,6 +32,7 @@ var ActivityIndicatorIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, /** * Whether to show the indicator (true, the default) or hide it (false). */ diff --git a/Libraries/Components/DatePicker/DatePickerIOS.ios.js b/Libraries/Components/DatePicker/DatePickerIOS.ios.js index f9a0a6d90..ede2500ee 100644 --- a/Libraries/Components/DatePicker/DatePickerIOS.ios.js +++ b/Libraries/Components/DatePicker/DatePickerIOS.ios.js @@ -41,6 +41,7 @@ var DatePickerIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, /** * The currently selected date. */ diff --git a/Libraries/Components/MapView/MapView.js b/Libraries/Components/MapView/MapView.js index 2b6860786..de8aaa9f7 100644 --- a/Libraries/Components/MapView/MapView.js +++ b/Libraries/Components/MapView/MapView.js @@ -63,6 +63,7 @@ var MapView = React.createClass({ }, propTypes: { + ...View.propTypes, /** * Used to style and layout the `MapView`. See `StyleSheet.js` and * `ViewStylePropTypes.js` for more info. diff --git a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js index 1588d21eb..fb2175b99 100644 --- a/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js +++ b/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js @@ -14,6 +14,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var React = require('React'); var ReactPropTypes = require('ReactPropTypes'); var ReactNativeViewAttributes = require('ReactNativeViewAttributes'); +var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); @@ -63,6 +64,7 @@ var indeterminateType = function(props, propName, componentName) { */ var ProgressBarAndroid = React.createClass({ propTypes: { + ...View.propTypes, /** * Style of the ProgressBar. One of: * diff --git a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js index c8ff595d5..fa1a0e2e6 100644 --- a/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js +++ b/Libraries/Components/ProgressViewIOS/ProgressViewIOS.ios.js @@ -17,6 +17,7 @@ var NativeModules = require('NativeModules'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var StyleSheet = require('StyleSheet'); +var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); @@ -27,6 +28,7 @@ var ProgressViewIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, /** * The progress bar style. */ diff --git a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js index 0fcc92e88..6393e89da 100644 --- a/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js +++ b/Libraries/Components/SegmentedControlIOS/SegmentedControlIOS.ios.js @@ -16,6 +16,7 @@ var NativeModules = require('NativeModules'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var StyleSheet = require('StyleSheet'); +var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); @@ -35,6 +36,7 @@ var SegmentedControlIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, /** * The labels for the control's segment buttons, in order. */ diff --git a/Libraries/Components/SliderIOS/SliderIOS.ios.js b/Libraries/Components/SliderIOS/SliderIOS.ios.js index a23fb5c45..f151a29b7 100644 --- a/Libraries/Components/SliderIOS/SliderIOS.ios.js +++ b/Libraries/Components/SliderIOS/SliderIOS.ios.js @@ -26,6 +26,7 @@ var SliderIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, /** * Used to style and layout the `Slider`. See `StyleSheet.js` and * `ViewStylePropTypes.js` for more info. diff --git a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js index e267c2d41..35514f66f 100644 --- a/Libraries/Components/SwitchIOS/SwitchIOS.ios.js +++ b/Libraries/Components/SwitchIOS/SwitchIOS.ios.js @@ -17,6 +17,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var PropTypes = require('ReactPropTypes'); var React = require('React'); var StyleSheet = require('StyleSheet'); +var View = require('View'); var requireNativeComponent = require('requireNativeComponent'); @@ -40,6 +41,7 @@ var SwitchIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, /** * The value of the switch, if true the switch will be turned on. * Default value is false. diff --git a/Libraries/Components/TabBarIOS/TabBarIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarIOS.ios.js index 0be39a8f1..660c8c62a 100644 --- a/Libraries/Components/TabBarIOS/TabBarIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarIOS.ios.js @@ -24,6 +24,7 @@ var TabBarIOS = React.createClass({ }, propTypes: { + ...View.propTypes, style: View.propTypes.style, /** * Color of the currently selected tab icon diff --git a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js index 94285e466..a4c883bc9 100644 --- a/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js +++ b/Libraries/Components/TabBarIOS/TabBarItemIOS.ios.js @@ -21,6 +21,7 @@ var requireNativeComponent = require('requireNativeComponent'); var TabBarItemIOS = React.createClass({ propTypes: { + ...View.propTypes, /** * Little red bubble that sits at the top right of the icon. */ diff --git a/Libraries/Components/WebView/WebView.ios.js b/Libraries/Components/WebView/WebView.ios.js index 9256c3c86..5e303ff00 100644 --- a/Libraries/Components/WebView/WebView.ios.js +++ b/Libraries/Components/WebView/WebView.ios.js @@ -88,6 +88,7 @@ var WebView = React.createClass({ }, propTypes: { + ...View.propTypes, url: PropTypes.string, html: PropTypes.string, renderError: PropTypes.func, // view to show if there's an error diff --git a/Libraries/Picker/PickerIOS.ios.js b/Libraries/Picker/PickerIOS.ios.js index 1a965b32f..924f13573 100644 --- a/Libraries/Picker/PickerIOS.ios.js +++ b/Libraries/Picker/PickerIOS.ios.js @@ -29,6 +29,7 @@ var PickerIOS = React.createClass({ mixins: [NativeMethodsMixin], propTypes: { + ...View.propTypes, onValueChange: React.PropTypes.func, selectedValue: React.PropTypes.any, // string or integer basically }, diff --git a/Libraries/RCTTest/SnapshotViewIOS.ios.js b/Libraries/RCTTest/SnapshotViewIOS.ios.js index 275da771c..7b6294be1 100644 --- a/Libraries/RCTTest/SnapshotViewIOS.ios.js +++ b/Libraries/RCTTest/SnapshotViewIOS.ios.js @@ -38,6 +38,7 @@ var SnapshotViewIOS = React.createClass({ }, propTypes: { + ...View.propTypes, // A callback when the Snapshot view is ready to be compared onSnapshotReady : React.PropTypes.func, // A name to identify the individual instance to the SnapshotView