Skip to content

Commit

Permalink
RN: Re-enable useInsertionEffectsForAnimations (facebook#48708)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#48708

{D68171721} [facebook#48678](facebook#48678) mitigated the bug that necessitated this revert.

Changelog:
[General][Changed] - (Reapply) The `AnimatedNode` graph will not occur during the insertion effect phase, which means animations can now be reliably started during layout effects.

Reviewed By: sammy-SC

Differential Revision: D68217144

fbshipit-source-id: 6796440f2839d897158528642e07869951651327
  • Loading branch information
yungsters authored and facebook-github-bot committed Jan 15, 2025
1 parent e566c1e commit e0c0476
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,12 @@ const definitions: FeatureFlagDefinitions = {
},
},
useInsertionEffectsForAnimations: {
defaultValue: false,
defaultValue: true,
metadata: {
dateAdded: '2024-09-12',
description:
'Changes construction of the animation graph to `useInsertionEffect` instead of `useLayoutEffect`.',
expectedReleaseValue: true,
purpose: 'experimentation',
purpose: 'release',
},
},
useRefsForTextInputState: {
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<<a88e25ee1e5bb8a324ff861c0703b9aa>>
* @generated SignedSource<<b7909873b5a9f72390db3a451f719b83>>
* @flow strict
*/

Expand Down Expand Up @@ -177,7 +177,7 @@ export const shouldUseSetNativePropsInFabric: Getter<boolean> = createJavaScript
/**
* Changes construction of the animation graph to `useInsertionEffect` instead of `useLayoutEffect`.
*/
export const useInsertionEffectsForAnimations: Getter<boolean> = createJavaScriptFlagGetter('useInsertionEffectsForAnimations', false);
export const useInsertionEffectsForAnimations: Getter<boolean> = createJavaScriptFlagGetter('useInsertionEffectsForAnimations', true);

/**
* Enable a variant of TextInput that moves some state to refs to avoid unnecessary re-renders
Expand Down

0 comments on commit e0c0476

Please sign in to comment.