Skip to content

Commit

Permalink
Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag (f…
Browse files Browse the repository at this point in the history
…acebook#46598)

Summary:
Pull Request resolved: facebook#46598

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.

Reviewed By: GijsWeterings

Differential Revision: D63252185
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 23, 2024
1 parent 9eafec4 commit f7cd904
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,10 @@ export default class Animation {
if (value != null) {
animatedValue.__onAnimatedValueUpdateReceived(value);

if (this.__isLooping) {
if (
ReactNativeFeatureFlags.shouldSkipStateUpdatesForLoopingAnimations() &&
this.__isLooping
) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,15 @@ const definitions: FeatureFlagDefinitions = {
purpose: 'release',
},
},
shouldSkipStateUpdatesForLoopingAnimations: {
defaultValue: false,
metadata: {
dateAdded: '2024-07-25',
description:
'If the animation is within Animated.loop, we do not send state updates to React.',
purpose: 'experimentation',
},
},
shouldUseAnimatedObjectForTransform: {
defaultValue: false,
metadata: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<<79bdedd5a09ba284cdaa2e4f40ffd2fd>>
* @generated SignedSource<<b7171b730c25a06f13d74306e1bffd8b>>
* @flow strict
*/

Expand Down Expand Up @@ -36,6 +36,7 @@ export type ReactNativeFeatureFlagsJsOnly = {
enableAnimatedPropsMemo: Getter<boolean>,
enableOptimisedVirtualizedCells: Getter<boolean>,
isLayoutAnimationEnabled: Getter<boolean>,
shouldSkipStateUpdatesForLoopingAnimations: Getter<boolean>,
shouldUseAnimatedObjectForTransform: Getter<boolean>,
shouldUseRemoveClippedSubviewsAsDefaultOnIOS: Getter<boolean>,
shouldUseSetNativePropsInFabric: Getter<boolean>,
Expand Down Expand Up @@ -146,6 +147,11 @@ export const enableOptimisedVirtualizedCells: Getter<boolean> = createJavaScript
*/
export const isLayoutAnimationEnabled: Getter<boolean> = createJavaScriptFlagGetter('isLayoutAnimationEnabled', true);

/**
* If the animation is within Animated.loop, we do not send state updates to React.
*/
export const shouldSkipStateUpdatesForLoopingAnimations: Getter<boolean> = createJavaScriptFlagGetter('shouldSkipStateUpdatesForLoopingAnimations', false);

/**
* Enables use of AnimatedObject for animating transform values.
*/
Expand Down

0 comments on commit f7cd904

Please sign in to comment.