diff --git a/packages/react-native/src/private/animated/NativeAnimatedHelper.js b/packages/react-native/src/private/animated/NativeAnimatedHelper.js index 3bede66b84e..805e2eb8c22 100644 --- a/packages/react-native/src/private/animated/NativeAnimatedHelper.js +++ b/packages/react-native/src/private/animated/NativeAnimatedHelper.js @@ -57,7 +57,7 @@ const eventListenerAnimationFinishedCallbacks: { let globalEventEmitterGetValueListener: ?EventSubscription = null; let globalEventEmitterAnimationFinishedListener: ?EventSubscription = null; -const shouldSignalBatch = +const shouldSignalBatch: boolean = ReactNativeFeatureFlags.animatedShouldSignalBatch() || ReactNativeFeatureFlags.cxxNativeAnimatedEnabled(); @@ -440,6 +440,7 @@ export default { generateNewAnimationId, assertNativeAnimatedModule, shouldUseNativeDriver, + shouldSignalBatch, transformDataType, // $FlowExpectedError[unsafe-getters-setters] - unsafe getter lint suppression // $FlowExpectedError[missing-type-arg] - unsafe getter lint suppression diff --git a/packages/react-native/src/private/animated/createAnimatedPropsHook.js b/packages/react-native/src/private/animated/createAnimatedPropsHook.js index 222d5a0a6d5..4f76a4fb4cd 100644 --- a/packages/react-native/src/private/animated/createAnimatedPropsHook.js +++ b/packages/react-native/src/private/animated/createAnimatedPropsHook.js @@ -66,9 +66,13 @@ export default function createAnimatedPropsHook( ); useEffect(() => { - // If multiple components call `flushQueue`, the first one will flush the - // queue and subsequent ones will do nothing. - NativeAnimatedHelper.API.flushQueue(); + // Animated queue flush is handled deterministically in setImmediate for the following feature flags: + // animatedShouldSignalBatch, cxxNativeAnimatedEnabled + if (!NativeAnimatedHelper.shouldSignalBatch) { + // If multiple components call `flushQueue`, the first one will flush the + // queue and subsequent ones will do nothing. + NativeAnimatedHelper.API.flushQueue(); + } let drivenAnimationEndedListener: ?EventSubscription = null; if (node.__isNative) { drivenAnimationEndedListener =