Skip to content

Commit e1e388d

Browse files
dmytrorykunfacebook-github-bot
authored andcommitted
Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag
Summary: Changelog: [General][Changed] - Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag Facebook Also bring back `skip_state_updates_for_looping_animations` MC. This will allow the experiment to participate in a holdout properly. Differential Revision: D63252185
1 parent bd32392 commit e1e388d

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

packages/react-native/Libraries/Animated/animations/Animation.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ export default class Animation {
110110
if (value != null) {
111111
animatedValue.__onAnimatedValueUpdateReceived(value);
112112

113-
if (this.__isLooping) {
113+
if (
114+
ReactNativeFeatureFlags.shouldSkipStateUpdatesForLoopingAnimations() &&
115+
this.__isLooping
116+
) {
114117
return;
115118
}
116119

packages/react-native/scripts/featureflags/ReactNativeFeatureFlags.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,11 @@ const definitions: FeatureFlagDefinitions = {
328328
description:
329329
'Function used to enable / disabled Layout Animations in React Native.',
330330
},
331+
shouldSkipStateUpdatesForLoopingAnimations: {
332+
defaultValue: false,
333+
description:
334+
'If the animation is within Animated.loop, we do not send state updates to React.',
335+
},
331336
shouldUseAnimatedObjectForTransform: {
332337
defaultValue: false,
333338
description:

packages/react-native/src/private/featureflags/ReactNativeFeatureFlags.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<79bdedd5a09ba284cdaa2e4f40ffd2fd>>
7+
* @generated SignedSource<<b7171b730c25a06f13d74306e1bffd8b>>
88
* @flow strict
99
*/
1010

@@ -36,6 +36,7 @@ export type ReactNativeFeatureFlagsJsOnly = {
3636
enableAnimatedPropsMemo: Getter<boolean>,
3737
enableOptimisedVirtualizedCells: Getter<boolean>,
3838
isLayoutAnimationEnabled: Getter<boolean>,
39+
shouldSkipStateUpdatesForLoopingAnimations: Getter<boolean>,
3940
shouldUseAnimatedObjectForTransform: Getter<boolean>,
4041
shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean>,
4142
shouldUseSetNativePropsInFabric: Getter<boolean>,
@@ -146,6 +147,11 @@ export const enableOptimisedVirtualizedCells: Getter<boolean> = createJavaScript
146147
*/
147148
export const isLayoutAnimationEnabled: Getter<boolean> = createJavaScriptFlagGetter('isLayoutAnimationEnabled', true);
148149

150+
/**
151+
* If the animation is within Animated.loop, we do not send state updates to React.
152+
*/
153+
export const shouldSkipStateUpdatesForLoopingAnimations: Getter<boolean> = createJavaScriptFlagGetter('shouldSkipStateUpdatesForLoopingAnimations', false);
154+
149155
/**
150156
* Enables use of AnimatedObject for animating transform values.
151157
*/

0 commit comments

Comments
 (0)