diff --git a/React/Executors/RCTJSCExecutor.mm b/React/Executors/RCTJSCExecutor.mm index 276820dfb..b12579a61 100644 --- a/React/Executors/RCTJSCExecutor.mm +++ b/React/Executors/RCTJSCExecutor.mm @@ -270,6 +270,9 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) if (!_context) { JSContext *context = [JSContext new]; _context = [[RCTJavaScriptContext alloc] initWithJSContext:context onThread:_javaScriptThread]; + + [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptContextCreatedNotification + object:context]; } return _context; @@ -413,9 +416,6 @@ static void RCTInstallJSCProfiler(RCTBridge *bridge, JSContextRef context) JSContext *context = strongSelf.context.context; RCTInstallJSCProfiler(_bridge, context.JSGlobalContextRef); - - [[NSNotificationCenter defaultCenter] postNotificationName:RCTJavaScriptContextCreatedNotification - object:context]; }]; for (NSString *event in @[RCTProfileDidStartProfiling, RCTProfileDidEndProfiling]) {