Skip to content

Commit bda05f9

Browse files
Thomas0cfacebook-github-bot
authored andcommitted
Rename and move ViewStylePropTypes (facebook#21415)
Summary: Related to facebook#21342 * Renamed ViewStyleProps to DeprecatedViewStyleProps. * Moved propType declaration to `react-native/Libraries/DeprecatedPropTypes` * ImageProps.js: moved propType declarations to DeprecatedImageProps.js. Pull Request resolved: facebook#21415 Reviewed By: TheSavior Differential Revision: D10119599 Pulled By: RSNara fbshipit-source-id: 67674039a88dcd570973c7062f86ebdbd6987d28
1 parent 0414d4b commit bda05f9

File tree

7 files changed

+15
-13
lines changed

7 files changed

+15
-13
lines changed

Libraries/Animated/src/createAnimatedComponent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
const {AnimatedEvent} = require('./AnimatedEvent');
1313
const AnimatedProps = require('./nodes/AnimatedProps');
1414
const React = require('React');
15-
const ViewStylePropTypes = require('ViewStylePropTypes');
15+
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
1616

1717
const invariant = require('fbjs/lib/invariant');
1818

@@ -184,7 +184,7 @@ function createAnimatedComponent(Component: any): any {
184184
return;
185185
}
186186

187-
for (const key in ViewStylePropTypes) {
187+
for (const key in DeprecatedViewStylePropTypes) {
188188
if (!propTypes[key] && props[key] !== undefined) {
189189
console.warn(
190190
'You are setting the style `{ ' +

Libraries/Components/Slider/Slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ type Props = $ReadOnly<{|
6666

6767
/**
6868
* Used to style and layout the `Slider`. See `StyleSheet.js` and
69-
* `ViewStylePropTypes.js` for more info.
69+
* `DeprecatedViewStylePropTypes.js` for more info.
7070
*/
7171
style?: ?ViewStyleProp,
7272

Libraries/Components/View/ReactNativeStyleAttributes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
1414
const TextStylePropTypes = require('TextStylePropTypes');
15-
const ViewStylePropTypes = require('ViewStylePropTypes');
15+
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
1616

1717
const processColor = require('processColor');
1818
const processTransform = require('processTransform');
@@ -21,7 +21,7 @@ const sizesDiffer = require('sizesDiffer');
2121
const ReactNativeStyleAttributes = {};
2222

2323
for (const attributeName of Object.keys({
24-
...ViewStylePropTypes,
24+
...DeprecatedViewStylePropTypes,
2525
...TextStylePropTypes,
2626
...DeprecatedImageStylePropTypes,
2727
})) {

Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const DeprecatedEdgeInsetsPropType = require('DeprecatedEdgeInsetsPropType');
1414
const PlatformViewPropTypes = require('PlatformViewPropTypes');
1515
const PropTypes = require('prop-types');
1616
const DeprecatedStyleSheetPropType = require('DeprecatedStyleSheetPropType');
17-
const ViewStylePropTypes = require('ViewStylePropTypes');
17+
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
1818

1919
const {
2020
AccessibilityComponentTypes,
@@ -23,7 +23,9 @@ const {
2323
AccessibilityStates,
2424
} = require('ViewAccessibility');
2525

26-
const stylePropType = DeprecatedStyleSheetPropType(ViewStylePropTypes);
26+
const stylePropType = DeprecatedStyleSheetPropType(
27+
DeprecatedViewStylePropTypes,
28+
);
2729

2830
module.exports = {
2931
/**

Libraries/Components/View/ViewStylePropTypes.js renamed to Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes');
1919
/**
2020
* Warning: Some of these properties may not be supported in all releases.
2121
*/
22-
const ViewStylePropTypes = {
22+
const DeprecatedViewStylePropTypes = {
2323
...LayoutPropTypes,
2424
...DeprecatedShadowPropTypesIOS,
2525
...DeprecatedTransformPropTypes,
@@ -58,4 +58,4 @@ const ViewStylePropTypes = {
5858
elevation: ReactPropTypes.number,
5959
};
6060

61-
module.exports = ViewStylePropTypes;
61+
module.exports = DeprecatedViewStylePropTypes;

Libraries/StyleSheet/StyleSheetValidation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
const DeprecatedImageStylePropTypes = require('DeprecatedImageStylePropTypes');
1414
const TextStylePropTypes = require('TextStylePropTypes');
15-
const ViewStylePropTypes = require('ViewStylePropTypes');
15+
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
1616

1717
const invariant = require('fbjs/lib/invariant');
1818

@@ -87,7 +87,7 @@ const allStylePropTypes = {};
8787
if (__DEV__ && !global.__RCTProfileIsProfiling) {
8888
StyleSheetValidation.addValidStylePropTypes(DeprecatedImageStylePropTypes);
8989
StyleSheetValidation.addValidStylePropTypes(TextStylePropTypes);
90-
StyleSheetValidation.addValidStylePropTypes(ViewStylePropTypes);
90+
StyleSheetValidation.addValidStylePropTypes(DeprecatedViewStylePropTypes);
9191
}
9292

9393
module.exports = StyleSheetValidation;

Libraries/Text/TextStylePropTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
const DeprecatedColorPropType = require('DeprecatedColorPropType');
1414
const ReactPropTypes = require('prop-types');
15-
const ViewStylePropTypes = require('ViewStylePropTypes');
15+
const DeprecatedViewStylePropTypes = require('DeprecatedViewStylePropTypes');
1616

1717
const TextStylePropTypes = {
18-
...ViewStylePropTypes,
18+
...DeprecatedViewStylePropTypes,
1919

2020
color: DeprecatedColorPropType,
2121
fontFamily: ReactPropTypes.string,

0 commit comments

Comments
 (0)