Skip to content

Commit

Permalink
'[skip ci] [RN][JS] BridgelessUIManager: Finish setLayoutAnimationEna…
Browse files Browse the repository at this point in the history
…bledExperimental

Summary:
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: 5cb356d0badb7582ce2e37835e24c82360f70a8b
  • Loading branch information
RSNara authored and facebook-github-bot committed Jan 9, 2024
1 parent e104f52 commit c508e8c
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c508e8c

Please sign in to comment.