From 9538c1e83e56b4c86c9b807ec9eafdc936ae9295 Mon Sep 17 00:00:00 2001 From: Zeya Peng Date: Sat, 14 Mar 2026 17:13:24 -0700 Subject: [PATCH] Revert RCTAnimatedModuleProvider change from D94244698 (#56100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56100 ## Changelog: [iOS] [Fixed] - Revert RCTAnimatedModuleProvider change from D94244698 D94244698 added a guard in RCTAnimatedModuleProvider that returns nullptr when useSharedAnimatedBackend() is true, expecting DefaultTurboModules to handle AnimatedModule creation instead. However, on iOS the TurboModule resolution chain in RCTReactNativeFactory delegates to the app-provided getTurboModule:jsInvoker: and returns whatever the delegate returns — even nullptr — without falling through to DefaultTurboModules. This causes `Invariant Violation: Native animated module is not available` on any surface using Animated.View (e.g. Marketplace PDP) when react_fabric.enable_shared_animated_backend_ios is enabled. Revert the RCTAnimatedModuleProvider change from D94244698 so it always provides AnimatedModule when cxxNativeAnimatedEnabled is true, regardless of useSharedAnimatedBackend. The shared backend path in DefaultTurboModules still exists as fallback for non-iOS platforms. Reviewed By: christophpurrer Differential Revision: D96611917 --- .../RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm b/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm index 5cc907bacc23..17914749a512 100644 --- a/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm +++ b/packages/react-native/ReactApple/RCTAnimatedModuleProvider/RCTAnimatedModuleProvider.mm @@ -70,10 +70,7 @@ - (void)_onDisplayLinkTick - (std::shared_ptr)getTurboModule:(const std::string &)name jsInvoker:(std::shared_ptr)jsInvoker { - if (facebook::react::ReactNativeFeatureFlags::cxxNativeAnimatedEnabled() && - // initialization is moved to DefaultTurboModules when using shared animated backend - // TODO: T257053961 deprecate RCTAnimatedModuleProvider. - !facebook::react::ReactNativeFeatureFlags::useSharedAnimatedBackend()) { + if (facebook::react::ReactNativeFeatureFlags::cxxNativeAnimatedEnabled()) { if (name == facebook::react::AnimatedModule::kModuleName) { __weak RCTAnimatedModuleProvider *weakSelf = self; auto provider = std::make_shared(