From e0baa6c1045ace9b4e60f21c7109205ce7ddbe6e Mon Sep 17 00:00:00 2001 From: Telechi Nicolae <39991250+tux2nicolae@users.noreply.github.com> Date: Sat, 28 Feb 2026 11:12:46 +0200 Subject: [PATCH 1/2] fix: add #else branch to createJSRuntimeFactory for USE_THIRD_PARTY_JSC When USE_THIRD_PARTY_JSC is set to 1, the #if block is skipped entirely, leaving createJSRuntimeFactory as a non-void function with no return statement, which causes a compilation error. Add an #else branch that raises an NSException (indicating subclasses must override this method) and returns nil to satisfy the compiler. --- .../AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm index f780a8911279..725c37baf52b 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTDefaultReactNativeFactoryDelegate.mm @@ -45,6 +45,10 @@ - (JSRuntimeFactoryRef)createJSRuntimeFactory { #if USE_THIRD_PARTY_JSC != 1 return jsrt_create_hermes_factory(); +#else + [NSException raise:@"JSRuntimeFactory" + format:@"createJSRuntimeFactory must be overridden when using third-party JSC"]; + return nil; #endif } From 538a5fb1bc209edb895e9ce0726de910a591cdc0 Mon Sep 17 00:00:00 2001 From: Telechi Nicolae Date: Sat, 28 Feb 2026 13:37:48 +0200 Subject: [PATCH 2/2] fix: skip Hermes pods when USE_THIRD_PARTY_JSC is enabled The hermes_enabled flag in use_react_native! was hardcoded to true, causing hermes-engine, React-hermes, and React-RuntimeHermes pods to always be installed even when USE_THIRD_PARTY_JSC=1. This change reads the USE_THIRD_PARTY_JSC environment variable via use_third_party_jsc() so that Hermes pods are excluded when a third-party JSC engine is configured. Fixes: https://github.com/facebook/react-native/issues/54268 --- packages/react-native/scripts/react_native_pods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index d157fce21723..264891cf10a3 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -78,7 +78,7 @@ def use_react_native! ( react_native_path = Pod::Config.instance.installation_root.join(path) prefix = react_native_path.relative_path_from(Pod::Config.instance.installation_root) - hermes_enabled= true + hermes_enabled= !use_third_party_jsc() # Set the app_path as env variable so the podspecs can access it. ENV['APP_PATH'] = app_path ENV['REACT_NATIVE_PATH'] = react_native_path.to_s