diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt index 8e099c30abc..b1eabaa0bf6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIBlock.kt @@ -7,7 +7,13 @@ package com.facebook.react.uimanager -/** A task to execute on the UI View for third party libraries. */ +/** + * A task to execute on the UI View for third party libraries. + * + * @deprecated This interface is part of the Legacy Architecture and will be removed in a future + * release. Use [com.facebook.react.bridge.UIManagerListener] or View Commands instead. + */ +@Deprecated("Use UIManagerListener or View Commands instead") public fun interface UIBlock { public fun execute( @Suppress("DEPRECATION") nativeViewHierarchyManager: NativeViewHierarchyManager diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index f3f2ef87d9f..fc5fe32dfe3 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -568,12 +568,11 @@ public class UIManagerModule extends ReactContextBaseJavaModule * after all currently queued view updates have completed. * * @param block that contains UI logic you want to execute. - *

Usage Example: - *

UIManagerModule uiManager = reactContext.getNativeModule(UIManagerModule.class); - * uiManager.addUIBlock(new UIBlock() { public void execute (NativeViewHierarchyManager nvhm) - * { View view = nvhm.resolveView(tag); // ...execute your code on View (e.g. snapshot the - * view) } }); + * @deprecated This method is a no-op stub retained for backward compatibility. Use {@link + * UIManagerListener} or View Commands instead. */ + @Deprecated + @SuppressWarnings("deprecation") public void addUIBlock(UIBlock block) {} /** @@ -581,7 +580,11 @@ public class UIManagerModule extends ReactContextBaseJavaModule * before all currently queued view updates have completed. * * @param block that contains UI logic you want to execute. + * @deprecated This method is a no-op stub retained for backward compatibility. Use {@link + * UIManagerListener} or View Commands instead. */ + @Deprecated + @SuppressWarnings("deprecation") public void prependUIBlock(UIBlock block) {} @Override