Skip to content

Commit

Permalink
Bring back shouldSkipStateUpdatesForLoopingAnimations feature flag
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 23, 2024
1 parent bd32392 commit e1e388d
Show file tree
Hide file tree
Showing 3 changed files with 16 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 @@ -328,6 +328,11 @@ const definitions: FeatureFlagDefinitions = {
description:
'Function used to enable / disabled Layout Animations in React Native.',
},
shouldSkipStateUpdatesForLoopingAnimations: {
defaultValue: false,
description:
'If the animation is within Animated.loop, we do not send state updates to React.',
},
shouldUseAnimatedObjectForTransform: {
defaultValue: false,
description:
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 e1e388d

Please sign in to comment.