Skip to content

Commit

Permalink
Ship shouldSkipStateUpdatesForLoopingAnimations (#46556)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #46556

Changelog: [General][Breaking] - Native looping animation will not send React state update every time it finishes.

Facebook
The QE shows neutral results, and has been shipped https://www.internalfb.com/intern/qe2/rn_surface_loading_performance/skip_state_updates_for_looping_animations/wrapup/config

Reviewed By: javache

Differential Revision: D62877191

fbshipit-source-id: 5b04105b3a33535c0da3bc7835098a9c4571d482
  • Loading branch information
dmytrorykun authored and facebook-github-bot committed Sep 18, 2024
1 parent 2f5adc3 commit 4b035d8
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,7 @@ export default class Animation {
if (value != null) {
animatedValue.__onAnimatedValueUpdateReceived(value);

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,6 @@ 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<<da9c8c080b54d86a30c4f671365ba990>>
* @generated SignedSource<<9d8783e80d0d82c086d9477aeb58d033>>
* @flow strict
*/

Expand Down Expand Up @@ -36,7 +36,6 @@ 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 @@ -145,11 +144,6 @@ 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 4b035d8

Please sign in to comment.