From 2b83552d1b2c9745b93ab37e7a46d06f9dab1d77 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Wed, 9 Sep 2026 03:33:34 -0700 Subject: [PATCH] Remove dead include from RCTInstance.h (#58181) Summary: Pull Request resolved: https://github.com/react/react-native/pull/58181 Under the C++ Stable API RFC, `jserrorhandler:jserrorhandler` is a "for frameworks" module, but it was still reached from a public header: - The iOS and macOS `RCTInstance.h` included `react/runtime/ReactInstance.h`, which in turn includes `jserrorhandler/JsErrorHandler.h`. Neither `RCTInstance.h` names `ReactInstance` or `JsErrorHandler`; the only C++ types they use are `JSRuntimeFactory` and `jsinspector_modern::HostTarget`, both already included directly. The include is dead and is simply removed. - `RCTInstance.mm` does name both types and was relying on the include transitively, so `react/runtime/ReactInstance.h` and `jserrorhandler/JsErrorHandler.h` move to the implementation file on both platforms. Changelog: [Internal] Reviewed By: javache Differential Revision: D117842042 fbshipit-source-id: 1b1e1545acbfc01be12d2af0ddc84d6b1ecf4ca3 --- .../react/runtime/platform/ios/ReactCommon/RCTInstance.h | 1 - .../react/runtime/platform/ios/ReactCommon/RCTInstance.mm | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h index b0aaf2dff5f..d05e49ceba1 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.h @@ -13,7 +13,6 @@ #import #import #import -#import #import "RCTContextContainerHandling.h" diff --git a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm index de522b07d03..26d5ff81b79 100644 --- a/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm +++ b/packages/react-native/ReactCommon/react/runtime/platform/ios/ReactCommon/RCTInstance.mm @@ -37,10 +37,12 @@ #import #import #import +#import #import #import #import #import +#import #import #import #import