From 0bb1a5a8677224e1a10cf2cb64eef5578d4fc732 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 10 Jan 2024 07:01:22 -0800 Subject: [PATCH] BridgelessUIManager: Finish setLayoutAnimationEnabledExperimental (#42207) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/42207 In open source, with the new architecture, layout animations are **always** enabled. They cannot be disabled. Therefore, when this UIManagerModule method is called with false, just report an error. That way, if layout animations were explicitly disabled on Android, the developer will know, when they try to enable the new architecture. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D52349297 fbshipit-source-id: 7969bd7294ce7369643004e5ff7e0c1ed4a59cd6 --- .../Libraries/ReactNative/BridgelessUIManager.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js b/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js index 55e1a44ffeb..d2e825e1912 100644 --- a/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js +++ b/packages/react-native/Libraries/ReactNative/BridgelessUIManager.js @@ -141,7 +141,16 @@ const UIManagerJSPlatformAPIs = Platform.select({ return []; }, setLayoutAnimationEnabledExperimental: (enabled: boolean): void => { - raiseSoftError('setLayoutAnimationEnabledExperimental'); + /** + * Layout animations are always enabled in the New Architecture. + * They cannot be turned off. + */ + if (!enabled) { + raiseSoftError( + 'setLayoutAnimationEnabledExperimental(false)', + 'Layout animations are always enabled in the New Architecture.', + ); + } }, // Please use AccessibilityInfo.sendAccessibilityEvent instead. // See SetAccessibilityFocusExample in AccessibilityExample.js for a migration example.