Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhongwuzw committed Oct 25, 2023
1 parent 0bfc535 commit 4fc5772
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
#endif
NSMutableDictionary *initProps = [[self prepareInitialProps] mutableCopy] ?: [NSMutableDictionary new];
[initProps addEntriesFromDictionary:[self extraInitialProps]];
[self updateInitialProps:initProps];

rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps];
}
Expand All @@ -144,20 +144,18 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
return nil;
}

- (NSDictionary *)extraInitialProps
- (void)updateInitialProps:(NSMutableDictionary *)initialProps
{
NSMutableDictionary *initProps = self.initialProps ? [self.initialProps mutableCopy] : [NSMutableDictionary new];
#ifdef RCT_NEW_ARCH_ENABLED
// Hardcoding the Concurrent Root as it it not recommended to
// have the concurrentRoot turned off when Fabric is enabled.
initProps[kRNConcurrentRoot] = @([self fabricEnabled]);
initialProps[kRNConcurrentRoot] = @([self fabricEnabled]);
#endif
return initProps;
}

- (NSDictionary *)prepareInitialProps
{
return nil;
return self.initialProps;
}

- (RCTBridge *)createBridgeWithDelegate:(id<RCTBridgeDelegate>)delegate launchOptions:(NSDictionary *)launchOptions
Expand Down

0 comments on commit 4fc5772

Please sign in to comment.