Skip to content

Commit 0da7e8d

Browse files
gvarandasfacebook-github-bot
authored andcommitted
Move and Rename propType definitions in TransformPropTypes (facebook#21375)
Summary: related facebook#21342 move TransformPropTypes.js fix flow error - [x] yarn prettier - [x] yarn flow-check-android - [x] yarn flow-check-ios All flow checks pass. [GENERAL] [ENHANCEMENT] [DeprecatedTransformPropTypes.js] - Created. Pull Request resolved: facebook#21375 Differential Revision: D10095453 Pulled By: TheSavior fbshipit-source-id: fbf677a000e3c6c0bd31e915dcafbd2d561be6e3
1 parent 95174d4 commit 0da7e8d

File tree

4 files changed

+22
-31
lines changed

4 files changed

+22
-31
lines changed

Libraries/Components/View/ViewStylePropTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ const ColorPropType = require('ColorPropType');
1414
const LayoutPropTypes = require('LayoutPropTypes');
1515
const ReactPropTypes = require('prop-types');
1616
const ShadowPropTypesIOS = require('ShadowPropTypesIOS');
17-
const TransformPropTypes = require('TransformPropTypes');
17+
const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes');
1818

1919
/**
2020
* Warning: Some of these properties may not be supported in all releases.
2121
*/
2222
const ViewStylePropTypes = {
2323
...LayoutPropTypes,
2424
...ShadowPropTypesIOS,
25-
...TransformPropTypes,
25+
...DeprecatedTransformPropTypes,
2626
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),
2727
backgroundColor: ColorPropType,
2828
borderColor: ColorPropType,

Libraries/StyleSheet/TransformPropTypes.js renamed to Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,7 @@ const DecomposedMatrixPropType = function(
4040
}
4141
};
4242

43-
const TransformPropTypes = {
44-
/**
45-
* `transform` accepts an array of transformation objects. Each object specifies
46-
* the property that will be transformed as the key, and the value to use in the
47-
* transformation. Objects should not be combined. Use a single key/value pair
48-
* per object.
49-
*
50-
* The rotate transformations require a string so that the transform may be
51-
* expressed in degrees (deg) or radians (rad). For example:
52-
*
53-
* `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`
54-
*
55-
* The skew transformations require a string so that the transform may be
56-
* expressed in degrees (deg). For example:
57-
*
58-
* `transform([{ skewX: '45deg' }])`
59-
*/
43+
const DeprecatedTransformPropTypes = {
6044
transform: ReactPropTypes.arrayOf(
6145
ReactPropTypes.oneOfType([
6246
ReactPropTypes.shape({perspective: ReactPropTypes.number}),
@@ -73,17 +57,8 @@ const TransformPropTypes = {
7357
ReactPropTypes.shape({skewY: ReactPropTypes.string}),
7458
]),
7559
),
76-
77-
/**
78-
* Deprecated. Use the transform prop instead.
79-
*/
8060
transformMatrix: TransformMatrixPropType,
81-
/**
82-
* Deprecated. Use the transform prop instead.
83-
*/
8461
decomposedMatrix: DecomposedMatrixPropType,
85-
86-
/* Deprecated transform props used on Android only */
8762
scaleX: deprecatedPropType(
8863
ReactPropTypes.number,
8964
'Use the transform prop instead.',
@@ -106,4 +81,4 @@ const TransformPropTypes = {
10681
),
10782
};
10883

109-
module.exports = TransformPropTypes;
84+
module.exports = DeprecatedTransformPropTypes;

Libraries/Image/ImageStylePropTypes.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ const ImageResizeMode = require('ImageResizeMode');
1414
const LayoutPropTypes = require('LayoutPropTypes');
1515
const ReactPropTypes = require('prop-types');
1616
const ShadowPropTypesIOS = require('ShadowPropTypesIOS');
17-
const TransformPropTypes = require('TransformPropTypes');
17+
const DeprecatedTransformPropTypes = require('DeprecatedTransformPropTypes');
1818

1919
const ImageStylePropTypes = {
2020
...LayoutPropTypes,
2121
...ShadowPropTypesIOS,
22-
...TransformPropTypes,
22+
...DeprecatedTransformPropTypes,
2323
resizeMode: ReactPropTypes.oneOf(Object.keys(ImageResizeMode)),
2424
backfaceVisibility: ReactPropTypes.oneOf(['visible', 'hidden']),
2525
backgroundColor: ColorPropType,

Libraries/StyleSheet/StyleSheetTypes.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,22 @@ export type ____LayoutStyle_Internal = $ReadOnly<{|
9090
|}>;
9191

9292
export type ____TransformStyle_Internal = $ReadOnly<{|
93+
/**
94+
* `transform` accepts an array of transformation objects. Each object specifies
95+
* the property that will be transformed as the key, and the value to use in the
96+
* transformation. Objects should not be combined. Use a single key/value pair
97+
* per object.
98+
*
99+
* The rotate transformations require a string so that the transform may be
100+
* expressed in degrees (deg) or radians (rad). For example:
101+
*
102+
* `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])`
103+
*
104+
* The skew transformations require a string so that the transform may be
105+
* expressed in degrees (deg). For example:
106+
*
107+
* `transform([{ skewX: '45deg' }])`
108+
*/
93109
transform?: $ReadOnlyArray<
94110
| {|+perspective: number | AnimatedNode|}
95111
| {|+rotate: string | AnimatedNode|}

0 commit comments

Comments
 (0)