Skip to content

Commit

Permalink
[RootView] Asynchronously load the bundle to give time to configure t…
Browse files Browse the repository at this point in the history
…he 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 facebook#288
  • Loading branch information
ide committed Apr 3, 2015
1 parent 1685fc5 commit d416492
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion React/Base/RCTRootView.m
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ - (void)setScriptURL:(NSURL *)scriptURL
}

_scriptURL = scriptURL;
[self loadBundle];
dispatch_async(dispatch_get_main_queue(), ^{
[self loadBundle];
});
}

- (void)layoutSubviews
Expand Down

0 comments on commit d416492

Please sign in to comment.