From 4e2f5bd7eaedec472ee7ddd413df7be6836e5633 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Mon, 10 Feb 2025 05:53:42 -0800 Subject: [PATCH] Complete rollout of shouldSkipStateUpdatesForLoopingAnimations (#49296) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/49296 Already fulled out by default in OSS and internally. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D69395210 fbshipit-source-id: 39b0d6f7a1a186d132d93105e360717835b442c5 --- .../Libraries/Animated/animations/Animation.js | 5 +---- .../featureflags/ReactNativeFeatureFlags.config.js | 11 ----------- .../private/featureflags/ReactNativeFeatureFlags.js | 8 +------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index 3df90974240..78242e911d2 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -145,10 +145,7 @@ export default class Animation { if (value != null) { animatedValue.__onAnimatedValueUpdateReceived(value); - if ( - ReactNativeFeatureFlags.shouldSkipStateUpdatesForLoopingAnimations() && - this.__isLooping === true - ) { + if (this.__isLooping === true) { return; } diff --git a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js index de29b61989e..64a810aa2df 100644 --- a/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js +++ b/packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js @@ -617,17 +617,6 @@ const definitions: FeatureFlagDefinitions = { }, ossReleaseStage: 'none', }, - shouldSkipStateUpdatesForLoopingAnimations: { - defaultValue: true, - metadata: { - dateAdded: '2024-07-25', - description: - 'If the animation is within Animated.loop, we do not send state updates to React.', - expectedReleaseValue: true, - purpose: 'experimentation', - }, - ossReleaseStage: 'none', - }, shouldUseAnimatedObjectForTransform: { defaultValue: false, metadata: { diff --git a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js index 4c32d295d76..30ca0820132 100644 --- a/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js +++ b/packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @generated SignedSource<<959e1f4818fbbf4bd7176638e6e4107d>> + * @generated SignedSource<> * @flow strict */ @@ -38,7 +38,6 @@ export type ReactNativeFeatureFlagsJsOnly = $ReadOnly<{ fixVirtualizeListCollapseWindowSize: Getter, isLayoutAnimationEnabled: Getter, scheduleAnimatedCleanupInMicrotask: Getter, - shouldSkipStateUpdatesForLoopingAnimations: Getter, shouldUseAnimatedObjectForTransform: Getter, shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter, shouldUseSetNativePropsInFabric: Getter, @@ -150,11 +149,6 @@ export const isLayoutAnimationEnabled: Getter = createJavaScriptFlagGet */ export const scheduleAnimatedCleanupInMicrotask: Getter = createJavaScriptFlagGetter('scheduleAnimatedCleanupInMicrotask', false); -/** - * If the animation is within Animated.loop, we do not send state updates to React. - */ -export const shouldSkipStateUpdatesForLoopingAnimations: Getter = createJavaScriptFlagGetter('shouldSkipStateUpdatesForLoopingAnimations', true); - /** * Enables use of AnimatedObject for animating transform values. */