mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
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:
committed by
Facebook Github Bot
parent
060a3ea3bf
commit
739651afa1
@@ -108,9 +108,7 @@ public abstract class HeadlessJsTaskService extends Service implements HeadlessJ
|
||||
reactInstanceManager.removeReactInstanceEventListener(this);
|
||||
}
|
||||
});
|
||||
if (!reactInstanceManager.hasStartedCreatingInitialContext()) {
|
||||
reactInstanceManager.createReactContextInBackground();
|
||||
}
|
||||
reactInstanceManager.createReactContextInBackground();
|
||||
} else {
|
||||
invokeStartTask(reactContext, taskConfig);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user