From f88924fcf0fbcaeee3e3eaeb29e78e4b9a64fcff Mon Sep 17 00:00:00 2001 From: Mark de Vocht Date: Tue, 5 May 2026 12:36:40 +0300 Subject: [PATCH] fix --- ios/RNNAppDelegate.mm | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ios/RNNAppDelegate.mm b/ios/RNNAppDelegate.mm index a9e8f1f139..5e33fa9e4c 100644 --- a/ios/RNNAppDelegate.mm +++ b/ios/RNNAppDelegate.mm @@ -4,7 +4,6 @@ #import #import "RCTAppSetupUtils.h" -#import #if __has_include() #import #endif @@ -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() + 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 @@ -119,6 +123,13 @@ - (RCTRootViewFactory *)createRCTRootViewFactory return [[RCTRootViewFactory alloc] initWithConfiguration:configuration andTurboModuleManagerDelegate:self]; } +#pragma mark - RCTTurboModuleManagerDelegate + +- (id)getModuleInstanceFromClass:(Class)moduleClass +{ + return RCTAppSetupDefaultModuleFromClass(moduleClass, self.dependencyProvider); +} + #pragma mark - Feature Flags class RCTAppDelegateBridgelessFeatureFlags : public facebook::react::ReactNativeFeatureFlagsDefaults { public: