Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions ios/RNNAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#import <react/featureflags/ReactNativeFeatureFlagsDefaults.h>

#import "RCTAppSetupUtils.h"
#import <React/CoreModulesPlugins.h>
#if __has_include(<React/RCTCxxBridgeDelegate.h>)
#import <React/RCTCxxBridgeDelegate.h>
#endif
Expand Down Expand Up @@ -56,12 +55,17 @@ @implementation RNNAppDelegate
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// RN 0.77 & RN0.78
#if !RNN_RN_VERSION_79_OR_NEWER
[self _setUpFeatureFlags];
#if __has_include(<ReactAppDependencyProvider/RCTAppDependencyProvider.h>)
self.dependencyProvider = [RCTAppDependencyProvider new];
#endif
// RN 0.77
#if !RNN_RN_VERSION_78
[self _setUpFeatureFlags];
self.rootViewFactory = [self createRCTRootViewFactory];
#else
self.reactNativeFactory = [[RCTReactNativeFactory alloc] init];
#else // RN0.78
self.reactNativeFactory = [[RCTReactNativeFactory alloc] initWithDelegate:self];
self.reactNativeFactory.rootViewFactory = [self createRCTRootViewFactory];
#endif

Expand Down Expand Up @@ -119,6 +123,13 @@ - (RCTRootViewFactory *)createRCTRootViewFactory
return [[RCTRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self];
}

#pragma mark - RCTTurboModuleManagerDelegate

- (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass
{
return RCTAppSetupDefaultModuleFromClass(moduleClass, self.dependencyProvider);
}

#pragma mark - Feature Flags
class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults {
public:
Expand Down