diff --git a/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js b/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js index 58eed675d949d9..5a6c508fd0411e 100644 --- a/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js +++ b/packages/react-native/Libraries/Animated/NativeAnimatedHelper.js @@ -425,6 +425,8 @@ const SUPPORTED_TRANSFORMS = { rotateY: true, rotateZ: true, perspective: true, + skewX: true, + skewY: true, matrix: ReactNativeFeatureFlags.shouldUseAnimatedObjectForTransform(), }; diff --git a/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js b/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js index 0a264a393e57b5..8fa2b271d1cf4e 100644 --- a/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js +++ b/packages/react-native/Libraries/StyleSheet/private/_TransformStyle.js @@ -44,8 +44,8 @@ export type ____TransformStyle_Internal = $ReadOnly<{| | [number | AnimatedNode, number | AnimatedNode] | AnimatedNode, |} - | {|+skewX: string|} - | {|+skewY: string|} + | {|+skewX: string | AnimatedNode|} + | {|+skewY: string | AnimatedNode|} // TODO: what is the actual type it expects? | {| +matrix: $ReadOnlyArray | AnimatedNode, diff --git a/packages/rn-tester/js/examples/Animated/TransformStylesExample.js b/packages/rn-tester/js/examples/Animated/TransformStylesExample.js index 45df54973810ae..60a90bc107a55a 100644 --- a/packages/rn-tester/js/examples/Animated/TransformStylesExample.js +++ b/packages/rn-tester/js/examples/Animated/TransformStylesExample.js @@ -74,10 +74,6 @@ function AnimatedView({ ); } -function notSupportedByNativeDriver(property: string) { - return property === 'skewX' || property === 'skewY'; -} - function AnimatedTransformStyleExample(): React.Node { const [properties, setProperties] = React.useState(transformProperties); const [useNativeDriver, setUseNativeDriver] = React.useState(false); @@ -109,9 +105,6 @@ function AnimatedTransformStyleExample(): React.Node { key={property} label={property} multiSelect - disabled={ - notSupportedByNativeDriver(property) && useNativeDriver - } selected={properties[property].selected} onPress={() => { onToggle(property); @@ -127,9 +120,7 @@ function AnimatedTransformStyleExample(): React.Node { useNativeDriver={useNativeDriver} // $FlowFixMe[incompatible-call] properties={Object.keys(properties).filter( - property => - properties[property].selected && - !(useNativeDriver && notSupportedByNativeDriver(property)), + property => properties[property].selected, )} /> @@ -163,7 +154,6 @@ const styles = StyleSheet.create({ export default ({ title: 'Transform Styles', name: 'transformStyles', - description: - 'Variations of transform styles. `skewX` and `skewY` are not supported on native driver.', + description: 'Variations of transform styles.', render: () => , }: RNTesterModuleExample);