Skip to content

Commit 02a411e

Browse files
christophpurrerhuntie
authored andcommitted
RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag (#41573)
Summary: Pull Request resolved: #41573 Changelog: [iOS][Fixed] RNTester-ios / RCTAppDelegate > correctly check for USE_HERMES Flag On iOS we check for ENV flags if Hermes should be used: - https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/React-Core.podspec#L24 - https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/React/React-RCTFabric.podspec#L90 and add necessary C++ packages based on that flag. In code we do check for those imports https://github.com/facebook/react-native/blob/b4d4aef057ebf90176287f22d72b4b3b8b280c9a/packages/react-native/Libraries/AppDelegate/RCTAppSetupUtils.h#L16-L27 and decided if we should use Hermes or not. However the .mm check is faulty and does not check for the `RCT_USE_HERMES` flag set in code. Reviewed By: fkgozali Differential Revision: D51483740 fbshipit-source-id: 428c27aae80fe6f9799cf6ae21a5d3801fe6ca11
1 parent 3da0959 commit 02a411e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#import <React/RCTSurfaceHostingProxyRootView.h>
2424
#import <React/RCTSurfacePresenter.h>
2525
#import <ReactCommon/RCTContextContainerHandling.h>
26-
#if USE_HERMES
26+
#if RCT_USE_HERMES
2727
#import <ReactCommon/RCTHermesInstance.h>
2828
#else
2929
#import <ReactCommon/RCTJscInstance.h>
@@ -291,7 +291,7 @@ - (void)createReactHost
291291

292292
- (std::shared_ptr<facebook::react::JSEngineInstance>)createJSEngineInstance
293293
{
294-
#if USE_HERMES
294+
#if RCT_USE_HERMES
295295
return std::make_shared<facebook::react::RCTHermesInstance>(_reactNativeConfig, nullptr);
296296
#else
297297
return std::make_shared<facebook::react::RCTJscInstance>();

0 commit comments

Comments
 (0)