Only ignore AnimatedProps that use vectorized animation on iOS (#38118)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/38118

https://github.com/facebook/react-native/pull/37925 mitigated an issue where vectorized animations (e.g. AnimatedColor) would flicker. This issue was nearly not as present in Android (flickering rarely happens). In fact, it greatly increased the flickering issues on Android.

This will make it so that AnimatedProps that use vectorized animation are only ignored on iOS until a more robust fix is available.

## Changelog
[General][Fixed] - AnimatedColor flickering on Android

Reviewed By: javache

Differential Revision: D47114536

fbshipit-source-id: a61bb11a316594d12c070a3149863fe5973745c5
This commit is contained in:
James Maxell Eroy
2023-07-06 21:34:06 -07:00
committed by Facebook GitHub Bot
parent 147a02039c
commit ec97646fe4
@@ -14,6 +14,7 @@ import type {PlatformConfig} from '../AnimatedPlatformConfig';
import type AnimatedNode from '../nodes/AnimatedNode';
import type AnimatedValue from '../nodes/AnimatedValue';
import Platform from '../../Utilities/Platform';
import NativeAnimatedHelper from '../NativeAnimatedHelper';
import AnimatedColor from '../nodes/AnimatedColor';
import AnimatedProps from '../nodes/AnimatedProps';
@@ -84,7 +85,10 @@ export default class Animation {
// may not have completed yet. For example, only the animation for the red channel of
// an animating color may have been completed, resulting in a temporary red color
// being rendered. So, for now, ignore AnimatedProps that use a vectorized animation.
if (node instanceof AnimatedValueXY || node instanceof AnimatedColor) {
if (
Platform.OS === 'ios' &&
(node instanceof AnimatedValueXY || node instanceof AnimatedColor)
) {
return result;
}