Rename and move ViewStylePropTypes (#21415)

Summary:
Related to #21342
* Renamed ViewStyleProps to DeprecatedViewStyleProps.
* Moved propType declaration to `react-native/Libraries/DeprecatedPropTypes`
*  ImageProps.js: moved propType declarations to DeprecatedImageProps.js.
Pull Request resolved: https://github.com/facebook/react-native/pull/21415

Reviewed By: TheSavior

Differential Revision: D10119599

Pulled By: RSNara

fbshipit-source-id: 67674039a88dcd570973c7062f86ebdbd6987d28
This commit is contained in:
Thomas Carlson
2018-10-01 12:13:06 -07:00
committed by Facebook Github Bot
parent c70abb393f
commit d6f3d37802
7 changed files with 15 additions and 13 deletions

View File

@@ -12,7 +12,7 @@
const {AnimatedEvent} = require('./AnimatedEvent');
const AnimatedProps = require('./nodes/AnimatedProps');
const React = require('React');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
const invariant = require('fbjs/lib/invariant');
@@ -184,7 +184,7 @@ function createAnimatedComponent(Component: any): any {
return;
}
for (const key in ViewStylePropTypes) {
for (const key in DeprecatedViewStylePropTypes) {
if (!propTypes[key] && props[key] !== undefined) {
console.warn(
'You are setting the style `{ ' +

View File

@@ -66,7 +66,7 @@ type Props = $ReadOnly<{|
/**
* Used to style and layout the `Slider`. See `StyleSheet.js` and
* `ViewStylePropTypes.js` for more info.
* `DeprecatedViewStylePropTypes.js` for more info.
*/
style?: ?ViewStyleProp,

View File

@@ -12,7 +12,7 @@
const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
const TextStylePropTypes = require('TextStylePropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
const processColor = require('processColor');
const processTransform = require('processTransform');
@@ -21,7 +21,7 @@ const sizesDiffer = require('sizesDiffer');
const ReactNativeStyleAttributes = {};
for (const attributeName of Object.keys({
...ViewStylePropTypes,
...DeprecatedViewStylePropTypes,
...TextStylePropTypes,
...DeprecatedImageStylePropTypes,
})) {

View File

@@ -14,7 +14,7 @@ const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType');
const PlatformViewPropTypes = require('PlatformViewPropTypes');
const PropTypes = require('prop-types');
const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
const {
AccessibilityComponentTypes,
@@ -23,7 +23,9 @@ const {
AccessibilityStates,
} = require('ViewAccessibility');
const stylePropType = DeprecatedStyleSheetPropType(ViewStylePropTypes);
const stylePropType = DeprecatedStyleSheetPropType(
DeprecatedViewStylePropTypes,
);
module.exports = {
/**

View File

@@ -19,7 +19,7 @@ const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes');
/**
* Warning: Some of these properties may not be supported in all releases.
*/
const ViewStylePropTypes = {
const DeprecatedViewStylePropTypes = {
...LayoutPropTypes,
...DeprecatedShadowPropTypesIOS,
...DeprecatedTransformPropTypes,
@@ -58,4 +58,4 @@ const ViewStylePropTypes = {
elevation: ReactPropTypes.number,
};
module.exports = ViewStylePropTypes;
module.exports = DeprecatedViewStylePropTypes;

View File

@@ -12,7 +12,7 @@
const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
const TextStylePropTypes = require('TextStylePropTypes');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
const invariant = require('fbjs/lib/invariant');
@@ -87,7 +87,7 @@ const allStylePropTypes = {};
if (__DEV__ && !global.__RCTProfileIsProfiling) {
StyleSheetValidation.addValidStylePropTypes(DeprecatedImageStylePropTypes);
StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes);
StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes);
StyleSheetValidation.addValidStylePropTypes(DeprecatedViewStylePropTypes);
}
module.exports = StyleSheetValidation;

View File

@@ -12,10 +12,10 @@
const DeprecatedColorPropType = require('DeprecatedColorPropType');
const ReactPropTypes = require('prop-types');
const ViewStylePropTypes = require('ViewStylePropTypes');
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
const TextStylePropTypes = {
...ViewStylePropTypes,
...DeprecatedViewStylePropTypes,
color: DeprecatedColorPropType,
fontFamily: ReactPropTypes.string,