diff --git a/React/Base/RCTBatchedBridge.m b/React/Base/RCTBatchedBridge.m index a407c693f..9a51a010c 100644 --- a/React/Base/RCTBatchedBridge.m +++ b/React/Base/RCTBatchedBridge.m @@ -80,12 +80,6 @@ typedef NS_ENUM(NSUInteger, RCTBridgeFields) { _displayLink = [RCTDisplayLink new]; [RCTBridge setCurrentBridge:self]; - - [[NSNotificationCenter defaultCenter] - postNotificationName:RCTJavaScriptWillStartLoadingNotification - object:_parentBridge userInfo:@{@"bridge": self}]; - - [self start]; } return self; } @@ -97,6 +91,10 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithDelegate:(id)dele - (void)start { + [[NSNotificationCenter defaultCenter] + postNotificationName:RCTJavaScriptWillStartLoadingNotification + object:_parentBridge userInfo:@{@"bridge": self}]; + RCT_PROFILE_BEGIN_EVENT(0, @"-[RCTBatchedBridge setUp]", nil); dispatch_queue_t bridgeQueue = dispatch_queue_create("com.facebook.react.RCTBridgeQueue", DISPATCH_QUEUE_CONCURRENT); diff --git a/React/Base/RCTBridge+Private.h b/React/Base/RCTBridge+Private.h index 6d74f5792..f9a2a53a5 100644 --- a/React/Base/RCTBridge+Private.h +++ b/React/Base/RCTBridge+Private.h @@ -80,6 +80,11 @@ RCT_EXTERN void RCTVerifyAllModulesExported(NSArray *extraModules); */ @property (nonatomic, assign, readonly) BOOL moduleSetupComplete; +/** + * Called on the child bridge to run the executor and start loading. + */ +- (void)start; + /** * Used by RCTModuleData to register the module for frame updates after it is * lazily initialized. @@ -142,5 +147,6 @@ RCT_EXTERN void RCTVerifyAllModulesExported(NSArray *extraModules); @property (nonatomic, assign, readonly) BOOL moduleSetupComplete; - (instancetype)initWithParentBridge:(RCTBridge *)bridge NS_DESIGNATED_INITIALIZER; +- (void)start; @end diff --git a/React/Base/RCTBridge.m b/React/Base/RCTBridge.m index e89cbf6c4..8720d5d75 100644 --- a/React/Base/RCTBridge.m +++ b/React/Base/RCTBridge.m @@ -296,6 +296,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init) _bundleURL = [RCTConvert NSURL:_bundleURL.absoluteString]; [self createBatchedBridge]; + [self.batchedBridge start]; RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @""); }