1// Copyright 2018-present 650 Industries. All rights reserved.
2
3#import <ExpoModulesCore/EXReactDelegateWrapper.h>
4
5#import <ExpoModulesCore/EXAppDefines.h>
6#import <ExpoModulesCore/EXReactDelegateWrapper+Private.h>
7
8@interface EXReactDelegateWrapper()
9
10@property (nonatomic, weak) EXReactDelegate *expoReactDelegate;
11
12@end
13
14@implementation EXReactDelegateWrapper
15
16- (instancetype)initWithExpoReactDelegate:(EXReactDelegate *)expoReactDelegate
17{
18  if (self = [super init]) {
19    _expoReactDelegate = expoReactDelegate;
20  }
21  return self;
22}
23
24- (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate
25                          launchOptions:(nullable NSDictionary *)launchOptions
26{
27  return [_expoReactDelegate createBridgeWithDelegate:delegate launchOptions:launchOptions];
28}
29
30- (RCTRootView *)createRootViewWithBridge:(RCTBridge *)bridge
31                               moduleName:(NSString *)moduleName
32                        initialProperties:(nullable NSDictionary *)initialProperties
33{
34  return [_expoReactDelegate createRootViewWithBridge:bridge
35                                           moduleName:moduleName
36                                    initialProperties:initialProperties
37                                        fabricEnabled:EXAppDefines.APP_NEW_ARCH_ENABLED];
38}
39
40- (RCTRootView *)createRootViewWithBridge:(RCTBridge *)bridge
41                               moduleName:(NSString *)moduleName
42                        initialProperties:(nullable NSDictionary *)initialProperties
43                            fabricEnabled:(BOOL)fabricEnabled
44{
45  return [_expoReactDelegate createRootViewWithBridge:bridge moduleName:moduleName initialProperties:initialProperties fabricEnabled:fabricEnabled];
46}
47
48- (UIViewController *)createRootViewController
49{
50  return [_expoReactDelegate createRootViewController];
51}
52
53@end
54