Ran codemod to replace View.propTypes with ViewPropTypes

Reviewed By: yungsters

Differential Revision: D4764838

fbshipit-source-id: 0b47a0fdd6793dab9333bb73bb93053fccc27dae
This commit is contained in:
Brian Vaughn 2017-03-24 00:22:57 -07:00 committed by Facebook Github Bot
parent f891985bd8
commit de8ce45258
31 changed files with 85 additions and 51 deletions

View File

@ -18,6 +18,8 @@ const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const requireNativeComponent = require('requireNativeComponent');
const PropTypes = React.PropTypes;
@ -40,7 +42,7 @@ const ActivityIndicator = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Whether to show the indicator (true, the default) or hide it (false).
*/

View File

@ -18,6 +18,8 @@ const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const requireNativeComponent = require('requireNativeComponent');
const PropTypes = React.PropTypes;
@ -43,7 +45,7 @@ const DatePickerIOS = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* The currently selected date.
*/

View File

@ -20,6 +20,8 @@ var StyleSheet = require('StyleSheet');
var UIManager = require('UIManager');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var DrawerConsts = UIManager.AndroidDrawerLayout.Constants;
var dismissKeyboard = require('dismissKeyboard');
@ -73,7 +75,7 @@ var DrawerLayoutAndroid = React.createClass({
},
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Determines whether the keyboard gets dismissed in response to a drag.
* - 'none' (the default), drags do not dismiss the keyboard.

View File

@ -18,6 +18,8 @@ const React = require('React');
const TimerMixin = require('react-timer-mixin');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const PropTypes = React.PropTypes;
import type EmitterSubscription from 'EmitterSubscription';
@ -57,13 +59,13 @@ const KeyboardAvoidingView = React.createClass({
mixins: [TimerMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
behavior: PropTypes.oneOf(['height', 'position', 'padding']),
/**
* The style of the content container(View) when behavior is 'position'.
*/
contentContainerStyle: View.propTypes.style,
contentContainerStyle: ViewPropTypes.style,
/**
* This is the distance between the top of the user screen and the react native view,

View File

@ -22,6 +22,8 @@ var StyleSheet = require('StyleSheet');
var TVEventHandler = require('TVEventHandler');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var invariant = require('fbjs/lib/invariant');
var logError = require('logError');
var requireNativeComponent = require('requireNativeComponent');
@ -406,7 +408,7 @@ var NavigatorIOS = React.createClass({
/**
* Styles for the navigation item containing the component.
*/
wrapperStyle: View.propTypes.style,
wrapperStyle: ViewPropTypes.style,
/**
* Boolean value that indicates whether the navigation bar is hidden.
@ -458,7 +460,7 @@ var NavigatorIOS = React.createClass({
* The default wrapper style for components in the navigator.
* A common use case is to set the `backgroundColor` for every scene.
*/
itemWrapperStyle: View.propTypes.style,
itemWrapperStyle: ViewPropTypes.style,
/**
* The default color used for the buttons in the navigation bar.

View File

@ -20,7 +20,7 @@ var React = require('React');
var StyleSheetPropType = require('StyleSheetPropType');
var TextStylePropTypes = require('TextStylePropTypes');
var UnimplementedView = require('UnimplementedView');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ViewStylePropTypes = require('ViewStylePropTypes');
var itemStylePropType = StyleSheetPropType(TextStylePropTypes);
@ -71,7 +71,7 @@ class Picker extends React.Component {
// $FlowFixMe(>=0.41.0)
static propTypes = {
...View.propTypes,
...ViewPropTypes,
style: pickerStyleType,
/**
* Value matching value of one of the items. Can be a string or an integer.

View File

@ -16,7 +16,7 @@ var ColorPropType = require('ColorPropType');
var React = require('React');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ViewStylePropTypes = require('ViewStylePropTypes');
var processColor = require('processColor');
@ -51,7 +51,7 @@ class PickerAndroid extends React.Component {
state: *;
static propTypes = {
...View.propTypes,
...ViewPropTypes,
style: pickerStyleType,
selectedValue: React.PropTypes.any,
enabled: ReactPropTypes.bool,

View File

@ -18,6 +18,7 @@ var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
var TextStylePropTypes = require('TextStylePropTypes');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var processColor = require('processColor');
var itemStylePropType = StyleSheetPropType(TextStylePropTypes);
@ -27,7 +28,7 @@ var PickerIOS = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
itemStyle: itemStylePropType,
onValueChange: React.PropTypes.func,
selectedValue: React.PropTypes.any, // string or integer basically

View File

@ -12,7 +12,7 @@
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ColorPropType = require('ColorPropType');
var requireNativeComponent = require('requireNativeComponent');
@ -66,7 +66,7 @@ var indeterminateType = function(props, propName, componentName) {
*/
var ProgressBarAndroid = React.createClass({
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Style of the ProgressBar. One of:
*

View File

@ -15,7 +15,7 @@ var Image = require('Image');
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
@ -29,7 +29,7 @@ var ProgressViewIOS = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* The progress bar style.
*/

View File

@ -15,7 +15,7 @@ const ColorPropType = require('ColorPropType');
const NativeMethodsMixin = require('NativeMethodsMixin');
const Platform = require('Platform');
const React = require('React');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const requireNativeComponent = require('requireNativeComponent');
@ -79,7 +79,7 @@ const RefreshControl = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Called when the view starts refreshing.
*/

View File

@ -23,6 +23,7 @@ const ScrollViewStickyHeader = require('ScrollViewStickyHeader');
const StyleSheet = require('StyleSheet');
const StyleSheetPropType = require('StyleSheetPropType');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const dismissKeyboard = require('dismissKeyboard');
@ -70,7 +71,7 @@ const requireNativeComponent = require('requireNativeComponent');
// $FlowFixMe(>=0.41.0)
const ScrollView = React.createClass({
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Controls whether iOS should automatically adjust the content inset
* for scroll views that are placed behind a navigation bar or

View File

@ -14,7 +14,7 @@
var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
@ -54,7 +54,7 @@ var SegmentedControlIOS = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* The labels for the control's segment buttons, in order.
*/

View File

@ -18,7 +18,7 @@ var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var Platform = require('Platform');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
@ -34,13 +34,13 @@ var Slider = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Used to style and layout the `Slider`. See `StyleSheet.js` and
* `ViewStylePropTypes.js` for more info.
*/
style: View.propTypes.style,
style: ViewPropTypes.style,
/**
* Initial value of the slider. The value should be between minimumValue

View File

@ -16,7 +16,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin');
var Platform = require('Platform');
var React = require('React');
var StyleSheet = require('StyleSheet');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
@ -41,7 +41,7 @@ type DefaultProps = {
// $FlowFixMe(>=0.41.0)
var Switch = React.createClass({
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* The value of the switch. If true the switch will be turned on.
* Default value is false.

View File

@ -15,7 +15,7 @@ var ColorPropType = require('ColorPropType');
var React = require('React');
var StyleSheet = require('StyleSheet');
var TabBarItemIOS = require('TabBarItemIOS');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
@ -34,8 +34,8 @@ class TabBarIOS extends React.Component {
// $FlowFixMe(>=0.41.0)
static propTypes = {
...View.propTypes,
style: View.propTypes.style,
...ViewPropTypes,
style: ViewPropTypes.style,
/**
* Color of text on unselected tabs
*/

View File

@ -18,11 +18,13 @@ var StaticContainer = require('StaticContainer.react');
var StyleSheet = require('StyleSheet');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
class TabBarItemIOS extends React.Component {
static propTypes = {
...View.propTypes,
...ViewPropTypes,
/**
* Little red bubble that sits at the top right of the icon.
*/
@ -80,7 +82,7 @@ class TabBarItemIOS extends React.Component {
/**
* React style object.
*/
style: View.propTypes.style,
style: ViewPropTypes.style,
/**
* Text that appears under the icon. It is ignored when a system icon
* is defined.

View File

@ -24,7 +24,7 @@ const TextInputState = require('TextInputState');
const TimerMixin = require('react-timer-mixin');
const TouchableWithoutFeedback = require('TouchableWithoutFeedback');
const UIManager = require('UIManager');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const emptyFunction = require('fbjs/lib/emptyFunction');
const invariant = require('fbjs/lib/invariant');
@ -176,7 +176,7 @@ const TextInput = React.createClass({
},
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Can tell `TextInput` to automatically capitalize certain characters.
*

View File

@ -16,7 +16,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin');
var React = require('React');
var ReactNativeViewAttributes = require('ReactNativeViewAttributes');
var UIManager = require('UIManager');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ColorPropType = require('ColorPropType');
var requireNativeComponent = require('requireNativeComponent');
@ -70,7 +70,7 @@ var ToolbarAndroid = React.createClass({
mixins: [NativeMethodsMixin],
propTypes: {
...View.propTypes,
...ViewPropTypes,
/**
* Sets possible actions on the toolbar as part of the action menu. These are displayed as icons
* or text on the right side of the widget. If they don't fit they are placed in an 'overflow'

View File

@ -23,6 +23,8 @@ var Touchable = require('Touchable');
var TouchableWithoutFeedback = require('TouchableWithoutFeedback');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ensureComponentIsNative = require('ensureComponentIsNative');
var ensurePositiveDelayProps = require('ensurePositiveDelayProps');
var keyOf = require('fbjs/lib/keyOf');
@ -79,7 +81,7 @@ var TouchableHighlight = React.createClass({
* active.
*/
underlayColor: ColorPropType,
style: View.propTypes.style,
style: ViewPropTypes.style,
/**
* Called immediately after the underlay is shown
*/

View File

@ -14,7 +14,7 @@
var React = require('React');
var ReactNative = require('ReactNative');
var UIManager = require('UIManager');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var dismissKeyboard = require('dismissKeyboard');
var requireNativeComponent = require('requireNativeComponent');
@ -81,7 +81,7 @@ class ViewPagerAndroid extends React.Component {
};
static propTypes = {
...View.propTypes,
...ViewPropTypes,
/**
* Index of initial page that should be selected. Use `setPage` method to
* update the page, and `onPageSelected` to monitor page changes

View File

@ -18,6 +18,8 @@ var StyleSheet = require('StyleSheet');
var UIManager = require('UIManager');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var deprecatedPropType = require('deprecatedPropType');
var keyMirror = require('fbjs/lib/keyMirror');
var requireNativeComponent = require('requireNativeComponent');
@ -46,7 +48,7 @@ var defaultRenderLoading = () => (
*/
class WebView extends React.Component {
static propTypes = {
...View.propTypes,
...ViewPropTypes,
renderError: PropTypes.func,
renderLoading: PropTypes.func,
onLoad: PropTypes.func,
@ -59,7 +61,7 @@ class WebView extends React.Component {
onMessage: PropTypes.func,
onContentSizeChange: PropTypes.func,
startInLoadingState: PropTypes.bool, // force WebView to show loadingView on first load
style: View.propTypes.style,
style: ViewPropTypes.style,
html: deprecatedPropType(
PropTypes.string,

View File

@ -19,6 +19,7 @@ var StyleSheet = require('StyleSheet');
var Text = require('Text');
var UIManager = require('UIManager');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ScrollView = require('ScrollView');
var deprecatedPropType = require('deprecatedPropType');
@ -117,7 +118,7 @@ class WebView extends React.Component {
static NavigationType = NavigationType;
static propTypes = {
...View.propTypes,
...ViewPropTypes,
html: deprecatedPropType(
PropTypes.string,
@ -253,7 +254,7 @@ class WebView extends React.Component {
/**
* The style to apply to the `WebView`.
*/
style: View.propTypes.style,
style: ViewPropTypes.style,
/**
* Determines the types of data converted to clickable URLs in the web views content.

View File

@ -29,7 +29,7 @@
*
* @providesModule Navigator
*/
/* eslint-disable no-extra-boolean-cast*/
/* eslint-disable no-extra-boolean-cast*/
'use strict';
var AnimationsDebugModule = require('NativeModules').AnimationsDebugModule;
@ -47,6 +47,8 @@ var TVEventHandler = require('TVEventHandler');
var TimerMixin = require('react-timer-mixin');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var clamp = require('clamp');
var flattenStyle = require('flattenStyle');
var invariant = require('fbjs/lib/invariant');
@ -385,7 +387,7 @@ var Navigator = React.createClass({
/**
* Styles to apply to the container of each scene.
*/
sceneStyle: View.propTypes.style,
sceneStyle: ViewPropTypes.style,
},
statics: {

View File

@ -39,6 +39,8 @@ const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const guid = require('guid');
const invariant = require('fbjs/lib/invariant');
@ -99,7 +101,7 @@ class NavigatorBreadcrumbNavigationBar extends React.Component {
routeStack: React.PropTypes.arrayOf(React.PropTypes.object),
presentedIndex: React.PropTypes.number,
}),
style: View.propTypes.style,
style: ViewPropTypes.style,
};
static Styles = NavigatorBreadcrumbNavigationBarStyles;

View File

@ -33,6 +33,8 @@ var Platform = require('Platform');
var StyleSheet = require('StyleSheet');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var guid = require('guid');
var { Map } = require('immutable');
@ -63,7 +65,7 @@ class NavigatorNavigationBar extends React.Component {
presentedIndex: React.PropTypes.number,
}),
navigationStyles: React.PropTypes.object,
style: View.propTypes.style,
style: ViewPropTypes.style,
};
static Styles = NavigatorNavigationBarStyles;

View File

@ -15,6 +15,8 @@ const IncrementalGroup = require('IncrementalGroup');
const React = require('React');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
import type {Context} from 'Incremental';
/**
@ -47,7 +49,7 @@ class IncrementalPresenter extends React.Component {
disabled: React.PropTypes.bool,
onDone: React.PropTypes.func,
onLayout: React.PropTypes.func,
style: View.propTypes.style,
style: ViewPropTypes.style,
};
static contextTypes = {
incrementalGroup: React.PropTypes.object,

View File

@ -29,6 +29,8 @@ const Text = require('Text');
const TouchableHighlight = require('TouchableHighlight');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
const {PropTypes} = React;
import type {ImageSource} from 'ImageSource';
@ -55,7 +57,7 @@ class SwipeableQuickActionButton extends React.Component {
imageSource: Image.propTypes.source.isRequired,
imageStyle: Image.propTypes.style,
onPress: PropTypes.func,
style: View.propTypes.style,
style: ViewPropTypes.style,
testID: PropTypes.string,
text: PropTypes.string,
textStyle: Text.propTypes.style,

View File

@ -27,6 +27,8 @@ const React = require('React');
const StyleSheet = require('StyleSheet');
const View = require('View');
const ViewPropTypes = require('ViewPropTypes');
/**
* A thin wrapper around standard quick action buttons that can, if the user
* chooses, be used with SwipeableListView. Sample usage is as follows, in the
@ -41,7 +43,7 @@ class SwipeableQuickActions extends React.Component {
props: {style?: $FlowFixMe};
static propTypes = {
style: View.propTypes.style,
style: ViewPropTypes.style,
};
render(): React.Element<any> {

View File

@ -22,6 +22,7 @@ var Set = require('Set');
var StyleSheet = require('StyleSheet');
var StyleSheetPropType = require('StyleSheetPropType');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var ViewStylePropTypes = require('ViewStylePropTypes');
var filterObject = require('fbjs/lib/filterObject');
@ -78,7 +79,7 @@ var ImageSpecificStyleKeys = new Set(Object.keys(ImageStylePropTypes).filter(x =
var Image = React.createClass({
propTypes: {
...View.propTypes,
...ViewPropTypes,
style: StyleSheetPropType(ImageStylePropTypes),
/**
* `uri` is a string representing the resource identifier for the image, which

View File

@ -17,6 +17,8 @@ var { TestModule } = require('NativeModules');
var UIManager = require('UIManager');
var View = require('View');
const ViewPropTypes = require('ViewPropTypes');
var requireNativeComponent = require('requireNativeComponent');
class SnapshotViewIOS extends React.Component {
@ -27,7 +29,7 @@ class SnapshotViewIOS extends React.Component {
// $FlowFixMe(>=0.41.0)
static propTypes = {
...View.propTypes,
...ViewPropTypes,
// 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