From 404d74bd1e46e5cbf83fcd37ddd24f83a26c8ada Mon Sep 17 00:00:00 2001 From: Garrett McCullough Date: Fri, 28 Jul 2017 12:46:02 -0700 Subject: [PATCH] update docs for Transforms Summary: Documentation change only. Filled out the Transforms docs a little more to indicate which props are now deprecated and to provide some guidance on the transform array since some values are expected to be strings and some are numbers http://facebook.github.io/react-native/docs/transforms.html Closes https://github.com/facebook/react-native/pull/15261 Differential Revision: D5518925 Pulled By: hramos fbshipit-source-id: 9aacf2c23e85573e150feb8c34e8bed54ad565d5 --- Libraries/StyleSheet/TransformPropTypes.js | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/Libraries/StyleSheet/TransformPropTypes.js b/Libraries/StyleSheet/TransformPropTypes.js index ae975a6f2..da3e39e56 100644 --- a/Libraries/StyleSheet/TransformPropTypes.js +++ b/Libraries/StyleSheet/TransformPropTypes.js @@ -42,6 +42,22 @@ var DecomposedMatrixPropType = function( }; var TransformPropTypes = { + /** + * `transform` accepts an array of transformation objects. Each object specifies + * the property that will be transformed as the key, and the value to use in the + * transformation. Objects should not be combined. Use a single key/value pair + * per object. + * + * The rotate transformations require a string so that the transform may be + * expressed in degrees (deg) or radians (rad). For example: + * + * `transform([{ rotateX: '45deg' }, { rotateZ: '0.785398rad' }])` + * + * The skew transformations require a string so that the transform may be + * expressed in degrees (deg). For example: + * + * `transform([{ skewX: '45deg' }])` + */ transform: ReactPropTypes.arrayOf( ReactPropTypes.oneOfType([ ReactPropTypes.shape({perspective: ReactPropTypes.number}), @@ -59,8 +75,13 @@ var TransformPropTypes = { ]) ), - /* Deprecated */ + /** + * Deprecated. Use the transform prop instead. + */ transformMatrix: TransformMatrixPropType, + /** + * Deprecated. Use the transform prop instead. + */ decomposedMatrix: DecomposedMatrixPropType, /* Deprecated transform props used on Android only */