From 4014aa4528d43e905246850c83007a635938d7cb Mon Sep 17 00:00:00 2001 From: Zeya Peng Date: Wed, 11 Sep 2024 09:58:04 -0700 Subject: [PATCH] correctly pass down isLooping in parallel animation (#46429) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/46429 Right now if I create a `Animated.loop(Animated.parallel(...))`, `config.__isLooping` for nested animations are not `true`. The reason is Animated.parallel doesn't pass down `isLooping`. This change is fixing that. Changelog: [General][Fixed] - correctly pass down isLooping in parallel animation Reviewed By: cipolleschi Differential Revision: D62473189 fbshipit-source-id: 405dd36aa008cc965599ff82333b5552df1eb41f --- .../react-native/Libraries/Animated/AnimatedImplementation.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Animated/AnimatedImplementation.js b/packages/react-native/Libraries/Animated/AnimatedImplementation.js index 0677cc0fd4b..ae641bc7fab 100644 --- a/packages/react-native/Libraries/Animated/AnimatedImplementation.js +++ b/packages/react-native/Libraries/Animated/AnimatedImplementation.js @@ -373,7 +373,7 @@ const parallel = function ( const stopTogether = !(config && config.stopTogether === false); const result = { - start: function (callback?: ?EndCallback) { + start: function (callback?: ?EndCallback, isLooping?: boolean) { if (doneCount === animations.length) { callback && callback({finished: true}); return; @@ -397,7 +397,7 @@ const parallel = function ( if (!animation) { cb({finished: true}); } else { - animation.start(cb); + animation.start(cb, isLooping); } }); },