diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 58570c0bcfc4d0..2bc4bab1bfb85f 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -434,8 +434,10 @@ public void run() { if (mShouldLogContentAppeared) { mShouldLogContentAppeared = false; - String jsModuleName = getJSModuleName(); - ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, jsModuleName, mRootViewTag); + + if (mJSModuleName != null) { + ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, mJSModuleName, mRootViewTag); + } } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java index 1c0116d367ed60..baa00162754930 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java @@ -375,9 +375,7 @@ public DevSupportManager getDevSupportManager() { public ReactSurface createSurface( Context context, String moduleName, @Nullable Bundle initialProps) { ReactSurfaceImpl surface = new ReactSurfaceImpl(context, moduleName, initialProps); - ReactSurfaceView surfaceView = new ReactSurfaceView(context, surface); - surfaceView.setShouldLogContentAppeared(true); - surface.attachView(surfaceView); + surface.attachView(new ReactSurfaceView(context, surface)); surface.attach(this); return surface; } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt index bc979de9c329c0..3ae5aba924ba91 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.kt @@ -134,8 +134,6 @@ public class ReactSurfaceView(context: Context?, private val surface: ReactSurfa // This surface view is always on Fabric. @UIManagerType override fun getUIManagerType(): Int = UIManagerType.FABRIC - override fun getJSModuleName(): String = surface.moduleName - override fun dispatchJSTouchEvent(event: MotionEvent) { val eventDispatcher = surface.eventDispatcher if (eventDispatcher != null) {