Skip to content

Commit

Permalink
update docs for Transforms
Browse files Browse the repository at this point in the history
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 #15261

Differential Revision: D5518925

Pulled By: hramos

fbshipit-source-id: 9aacf2c23e85573e150feb8c34e8bed54ad565d5
  • Loading branch information
gwmccull authored and facebook-github-bot committed Jul 28, 2017
1 parent 278cd57 commit 404d74b
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion Libraries/StyleSheet/TransformPropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}),
Expand All @@ -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 */
Expand Down

0 comments on commit 404d74b

Please sign in to comment.