From 8379ca16c886f21545f38f0b46da8a9301627648 Mon Sep 17 00:00:00 2001 From: Christian Falch Date: Thu, 25 Jun 2026 15:38:54 +0200 Subject: [PATCH] fix(apple): use RCT_REMOVE_LEGACY_ARCH to guard RCTCxxBridge usage React Native gates the removal of `RCTCxxBridge` (RCTBridge+Private.h) behind `RCT_REMOVE_LEGACY_ARCH`, not `RCT_DISABLE_LEGACY_ARCH`. The latter macro does not exist anywhere in React Native, so the `#ifndef` guard was always true and the legacy `RCTCxxBridge` branch was compiled in unconditionally. On React Native main (where `RCT_REMOVE_LEGACY_ARCH` is defined and `RCTCxxBridge` is fully compiled out) this fails to build: RNSkiaModule.mm:40:5: error: unknown type name 'RCTCxxBridge'; did you mean 'RCTBridge'? Switch the guard to the correct macro so the legacy branch is dropped when the legacy architecture is removed; the new-arch getTurboModule path already supplies jsInvoker in that configuration. Also fix the stale macro name in the SkiaManager.mm comment. Co-Authored-By: Claude Opus 4.8 (1M context) --- packages/skia/apple/RNSkiaModule.mm | 2 +- packages/skia/apple/SkiaManager.mm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/skia/apple/RNSkiaModule.mm b/packages/skia/apple/RNSkiaModule.mm index 9a3b6cb1c7..b70269f77f 100644 --- a/packages/skia/apple/RNSkiaModule.mm +++ b/packages/skia/apple/RNSkiaModule.mm @@ -35,7 +35,7 @@ - (void)invalidate { // Already initialized, ignore call. return @true; } -#ifndef RCT_DISABLE_LEGACY_ARCH +#ifndef RCT_REMOVE_LEGACY_ARCH if (!jsInvoker) { RCTCxxBridge *cxxBridge = (RCTCxxBridge *)self.bridge; jsInvoker = cxxBridge.jsCallInvoker; diff --git a/packages/skia/apple/SkiaManager.mm b/packages/skia/apple/SkiaManager.mm index 930712ddc9..5cc043c149 100644 --- a/packages/skia/apple/SkiaManager.mm +++ b/packages/skia/apple/SkiaManager.mm @@ -9,7 +9,7 @@ // Forward-declared runtime accessor that is satisfied by RCTCxxBridge // (legacy/transitional) and RCTBridgeProxy (bridgeless). Avoids referencing -// RCTCxxBridge directly, which is compiled out when RCT_DISABLE_LEGACY_ARCH +// RCTCxxBridge directly, which is compiled out when RCT_REMOVE_LEGACY_ARCH // is set (React Native 0.82+). @interface RCTBridge (RNSkiaRuntime) - (void *)runtime;