RN: Enable avoidStateUpdateInAnimatedPropsMemo by Default (#51635)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/51635

Enables a feature flag by default, that reduces the memory usage of`Animated`. For more details, see: https://github.com/facebook/react-native/pull/49184

Changelog:
[General][Changed] - Enabled a feature flag that optimizes `Animated` to reduce memory usage.

Reviewed By: jehartzog

Differential Revision: D75466724

fbshipit-source-id: 3fdb57f394448bbd0530dcb558a58958010d0edd
This commit is contained in:
Tim Yung
2025-05-27 14:17:30 -07:00
committed by Facebook GitHub Bot
parent 7ef278af50
commit 2a13d20085
2 changed files with 4 additions and 5 deletions
@@ -613,13 +613,12 @@ const definitions: FeatureFlagDefinitions = {
ossReleaseStage: 'none',
},
avoidStateUpdateInAnimatedPropsMemo: {
defaultValue: false,
defaultValue: true,
metadata: {
dateAdded: '2025-02-05',
description:
'Changes `useAnimatedPropsMemo` to avoid state updates to invalidate the cached `AnimatedProps`.',
expectedReleaseValue: true,
purpose: 'experimentation',
purpose: 'release',
},
ossReleaseStage: 'none',
},
@@ -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<<4d96a5f9132ea827faeb183fe8bbf095>>
* @generated SignedSource<<116217572bb442c615e346324966d670>>
* @flow strict
* @noformat
*/
@@ -121,7 +121,7 @@ export const animatedShouldUseSingleOp: Getter<boolean> = createJavaScriptFlagGe
/**
* Changes `useAnimatedPropsMemo` to avoid state updates to invalidate the cached `AnimatedProps`.
*/
export const avoidStateUpdateInAnimatedPropsMemo: Getter<boolean> = createJavaScriptFlagGetter('avoidStateUpdateInAnimatedPropsMemo', false);
export const avoidStateUpdateInAnimatedPropsMemo: Getter<boolean> = createJavaScriptFlagGetter('avoidStateUpdateInAnimatedPropsMemo', true);
/**
* Disables InteractionManager and replaces its scheduler with `setImmediate`.