RN: Simplify Context Creation (Android)

Summary:
Every call site is either already using `createReactContextInBackground` correctly or guarding the invocation using `hasStartedCreatingInitialContext`. This is an unnecessary and overly complex dance that can be simplified.

This revision simplifies the use of `createReactContextInBackground` by integrating the check. This is not a breaking change.

Reviewed By: zackargyle, mdvacca

Differential Revision: D15566632

fbshipit-source-id: 7b50285c9ac6776d1297d2c9c53dff208851b722
This commit is contained in:
Tim Yung
2019-05-30 18:50:43 -07:00
committed by Facebook Github Bot
parent 060a3ea3bf
commit 739651afa1
3 changed files with 7 additions and 17 deletions
@@ -394,9 +394,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
// TODO initialize surface here
}
if (!mReactInstanceManager.hasStartedCreatingInitialContext()) {
mReactInstanceManager.createReactContextInBackground();
}
mReactInstanceManager.createReactContextInBackground();
attachToReactInstanceManager();