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
This commit is contained in:
Ramanpreet Nara
2024-01-10 07:01:22 -08:00
committed by Facebook GitHub Bot
parent 07e3c2e6eb
commit 0bb1a5a867
@@ -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.