From d67d8ce2bd9ca38f5f39276fdbccfd9663195737 Mon Sep 17 00:00:00 2001 From: James Ide Date: Thu, 26 Mar 2015 18:17:11 -0700 Subject: [PATCH] [RootView] Asynchronously load the bundle to give time to configure the root view If you construct an RCTRootView you may want to configure the executor. However the constructor synchronously calls `loadBundle` and sets up the executor and bridge. This is a quick fix that uses dispatch_async to allow the current pass of the runloop time to set up the executor. Fixes #288 --- React/Base/RCTRootView.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/React/Base/RCTRootView.m b/React/Base/RCTRootView.m index ac39a9aed3a0cf..69d7c0ed20c13f 100644 --- a/React/Base/RCTRootView.m +++ b/React/Base/RCTRootView.m @@ -318,7 +318,9 @@ - (void)setScriptURL:(NSURL *)scriptURL } _scriptURL = scriptURL; - [self loadBundle]; + dispatch_async(dispatch_get_main_queue(), ^{ + [self loadBundle]; + }); } - (void)layoutSubviews