From 925d3d4ba1327e98789ce1af1393e1ca1e9379d3 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Wed, 10 Jun 2026 09:17:52 -0700 Subject: [PATCH] Remove dead test-only method simulateAttachForTesting from ReactRootView Summary: X-link: https://github.com/facebook/react-native/pull/57136 `ReactRootView.simulateAttachForTesting()` was a package-private `VisibleForTesting` helper that set up the attach flags and dispatchers, but no test or production code ever called it. `RootViewTest` exercises `startReactApplication`/`unmountReactApplication` and the sibling `simulateCheckForKeyboardForTesting`, never this method. This removes the orphaned helper. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D108012908 fbshipit-source-id: ee550f66fae07bfeb75fd59b85d5d812fea7e2c1 --- .../java/com/facebook/react/ReactRootView.java | 16 ---------------- 1 file changed, 16 deletions(-) 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 a6188100c52..f55eca6e4a7 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 @@ -776,22 +776,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { } } - /** - * Is used by unit test to setup mIsAttachedToWindow flags, that will let this view to be properly - * attached to catalyst instance by startReactApplication call - */ - @VisibleForTesting - /* package */ void simulateAttachForTesting() { - mIsAttachedToInstance = true; - mJSTouchDispatcher = new JSTouchDispatcher(this); - if (ReactFeatureFlags.dispatchPointerEvents) { - mJSPointerDispatcher = new JSPointerDispatcher(this); - } - if (ReactNativeFeatureFlags.enableKeyEvents()) { - mJSKeyDispatcher = new JSKeyDispatcher(); - } - } - @VisibleForTesting /* package */ void simulateCheckForKeyboardForTesting() { getCustomGlobalLayoutListener().checkForKeyboardEvents();