Skip to content

Commit e5d2d95

Browse files
sammy-SCmeta-codesync[bot]
authored andcommitted
Restore getUIImplementation() stub for backwards compatibility (#55798)
Summary: Pull Request resolved: #55798 D93806249 removed `getUIImplementation()` from `UIManagerModule` as part of the Legacy Architecture cleanup. However, third-party libraries like `react-native-safe-area-context` still reference this method, causing build failures in the e2e template app tests (https://github.com/facebook/react-native/actions/runs/22461280936/job/65112346970) This restores the method as a deprecated stub that returns `null`, maintaining backwards compatibility while keeping the Legacy Architecture cleanup intact. Libraries that depend on this method will need to handle the `null` return value or update to newer versions that don't use this deprecated API. Changelog: [Android][Fixed] - Restore getUIImplementation() stub for backwards compatibility with third-party libraries Reviewed By: cipolleschi Differential Revision: D94654682 fbshipit-source-id: b00bccb74ef8a2c39005630fcabe6c3ad1702206
1 parent 1eca581 commit e5d2d95

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4358,6 +4358,7 @@ public class com/facebook/react/uimanager/UIManagerModule : com/facebook/react/b
43584358
public fun getEventDispatcher ()Lcom/facebook/react/uimanager/events/EventDispatcher;
43594359
public fun getName ()Ljava/lang/String;
43604360
public fun getPerformanceCounters ()Ljava/util/Map;
4361+
public fun getUIImplementation ()Lcom/facebook/react/uimanager/UIImplementation;
43614362
public fun getViewManagerRegistry_DO_NOT_USE ()Lcom/facebook/react/uimanager/ViewManagerRegistry;
43624363
public fun initialize ()V
43634364
public fun invalidate ()V

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,16 @@ public ViewManagerRegistry getViewManagerRegistry_DO_NOT_USE() {
205205
return mViewManagerRegistry;
206206
}
207207

208+
/**
209+
* @deprecated This method is a stub retained for backward compatibility with third-party
210+
* libraries. It always returns null. UIImplementation is part of the Legacy Architecture and
211+
* will be removed in a future release.
212+
*/
213+
@Deprecated
214+
public @Nullable UIImplementation getUIImplementation() {
215+
return null;
216+
}
217+
208218
private static Map<String, Object> createConstants(ViewManagerResolver viewManagerResolver) {
209219
ReactMarker.logMarker(CREATE_UI_MANAGER_MODULE_CONSTANTS_START);
210220
SystraceMessage.beginSection(Systrace.TRACE_TAG_REACT, "CreateUIManagerConstants")

0 commit comments

Comments
 (0)