From dc737cb9094554ea5fb9b22deb3ff778f7c487a5 Mon Sep 17 00:00:00 2001 From: "Chang Liu (RL)" Date: Tue, 20 May 2025 20:58:50 -0700 Subject: [PATCH] Back out "Remove native animation fabric sync in JS and infinite animation loop workaround" (#51486) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51486 Original commit changeset: 5b313a5e8c07 Original Phabricator Diff: D74198568 Fix the issue that dropdown menus in HSR worlds menu are not clickable. Reviewed By: xieswufe Differential Revision: D75108344 fbshipit-source-id: d134ff9287929f8e1fc0995acf2b884d6a67131c --- .../Libraries/Animated/animations/Animation.js | 7 ++----- .../src/private/animated/createAnimatedPropsHook.js | 5 +---- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/packages/react-native/Libraries/Animated/animations/Animation.js b/packages/react-native/Libraries/Animated/animations/Animation.js index 35f43245bf8..6587e9189fd 100644 --- a/packages/react-native/Libraries/Animated/animations/Animation.js +++ b/packages/react-native/Libraries/Animated/animations/Animation.js @@ -13,7 +13,6 @@ import type AnimatedNode from '../nodes/AnimatedNode'; import type AnimatedValue from '../nodes/AnimatedValue'; import NativeAnimatedHelper from '../../../src/private/animated/NativeAnimatedHelper'; -import * as ReactNativeFeatureFlags from '../../../src/private/featureflags/ReactNativeFeatureFlags'; import AnimatedProps from '../nodes/AnimatedProps'; export type EndResult = { @@ -150,10 +149,8 @@ export default class Animation { if (value != null) { animatedValue.__onAnimatedValueUpdateReceived(value, offset); - if (!ReactNativeFeatureFlags.cxxNativeAnimatedEnabled()) { - if (this.__isLooping === true) { - return; - } + if (this.__isLooping === true) { + return; } // Once the JS side node is synced with the updated values, trigger an diff --git a/packages/react-native/src/private/animated/createAnimatedPropsHook.js b/packages/react-native/src/private/animated/createAnimatedPropsHook.js index 4f76a4fb4cd..444ec9eb8e9 100644 --- a/packages/react-native/src/private/animated/createAnimatedPropsHook.js +++ b/packages/react-native/src/private/animated/createAnimatedPropsHook.js @@ -132,10 +132,7 @@ export default function createAnimatedPropsHook( if (node.__isNative) { // Check 2: this is an animation driven by native. // In native driven animations, this callback is only called once the animation completes. - if ( - isFabricNode && - !ReactNativeFeatureFlags.cxxNativeAnimatedEnabled() - ) { + if (isFabricNode) { // Call `scheduleUpdate` to synchronise Fiber and Shadow tree. // Must not be called in Paper. scheduleUpdate();