Skip to content

Commit

Permalink
Enable animating transform matrix
Browse files Browse the repository at this point in the history
Summary:
With the addition of AnimatedObject, animating prop values with arbitrary map/array nestings are possible (including transform matrix).

Note: this is only enabled when ReactNativeFeatureFlags.isAnimatedObjectEnabled is true.

Changelog:
[General][Added] - Enable animating skew in transforms with native driver

Differential Revision: D45055381

fbshipit-source-id: d03af536c84d4b9b48173a6a76ab491fae0226f4
  • Loading branch information
genkikondo authored and facebook-github-bot committed Apr 17, 2023
1 parent 1ff3dcd commit 9680e44
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ const SUPPORTED_TRANSFORMS = {
perspective: true,
skewX: true,
skewY: true,
matrix: ReactNativeFeatureFlags.isAnimatedObjectEnabled(),
};

const SUPPORTED_INTERPOLATION_PARAMS = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ function createAnimatedStyle(
const animatedStyles: any = {};
for (const key in style) {
const value = style[key];
if (key === 'transform') {
if (
!ReactNativeFeatureFlags.isAnimatedObjectEnabled() &&
key === 'transform'
) {
animatedStyles[key] = new AnimatedTransform(value);
} else if (value instanceof AnimatedNode) {
animatedStyles[key] = value;
Expand Down

0 comments on commit 9680e44

Please sign in to comment.