1#import <EXDevLauncher/EXDevLauncherBridgeDelegate.h>
2#import <EXDevLauncher/EXDevLauncherController.h>
3
4#import <React/RCTBundleURLProvider.h>
5#if __has_include(<React_RCTAppDelegate/RCTAppSetupUtils.h>)
6// for importing the header from framework, the dash will be transformed to underscore
7#import <React_RCTAppDelegate/RCTAppSetupUtils.h>
8#else
9#import <React-RCTAppDelegate/RCTAppSetupUtils.h>
10#endif
11
12#ifdef RCT_NEW_ARCH_ENABLED
13
14static NSString *const kRNConcurrentRoot = @"concurrentRoot";
15
16#endif
17
18@implementation EXDevLauncherBridgeDelegate
19
20- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge {
21  return [[EXDevLauncherController sharedInstance] sourceURLForBridge:bridge];
22}
23
24- (RCTRootView *)createRootViewWithModuleName:(NSString *)moduleName launchOptions:(NSDictionary * _Nullable)launchOptions application:(UIApplication *)application{
25    BOOL enableTM = NO;
26#if RCT_NEW_ARCH_ENABLED
27    enableTM = YES;
28#endif
29
30    RCTAppSetupPrepareApp(application, enableTM);
31
32    self.bridge = [super createBridgeAndSetAdapterWithLaunchOptions:launchOptions];
33
34    NSMutableDictionary *initProps = [NSMutableDictionary new];
35#ifdef RCT_NEW_ARCH_ENABLED
36    initProps[kRNConcurrentRoot] = @YES;
37#endif
38
39
40    return [super createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
41}
42
43@end
44