Refactor: ReactHost: Rename getOrCreateReactInstanceTask -> getOrCreateReactInstance (#42165)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42165

This will help avoid a name collision when we remove the new suffix from newGetOrCreateReactInstanceTask.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D52495532

fbshipit-source-id: 79a04cff51eef07b91876a1351b8444654a79274
This commit is contained in:
Ramanpreet Nara
2024-01-09 19:07:01 -08:00
committed by Facebook GitHub Bot
parent 0fd7bd3a7f
commit 466deff0de
@@ -726,7 +726,7 @@ public class ReactHostImpl implements ReactHost {
if (mStartTask == null) {
log(method, "Schedule");
mStartTask =
getOrCreateReactInstanceTask()
getOrCreateReactInstance()
.continueWithTask(
task -> {
if (task.isFaulted()) {
@@ -824,7 +824,7 @@ public class ReactHostImpl implements ReactHost {
final String callingMethod, final VeniceThenable<ReactInstance> runnable) {
final String method = "callAfterGetOrCreateReactInstance(" + callingMethod + ")";
return getOrCreateReactInstanceTask()
return getOrCreateReactInstance()
.onSuccess(
(Continuation<ReactInstance, Void>)
task -> {
@@ -863,7 +863,7 @@ public class ReactHostImpl implements ReactHost {
* <p>If the ReactInstance is reloading, will return the reload task. If the ReactInstance is
* destroying, will wait until destroy is finished, before creating.
*/
private Task<ReactInstance> getOrCreateReactInstanceTask() {
private Task<ReactInstance> getOrCreateReactInstance() {
if (ReactFeatureFlags.enableBridgelessArchitectureNewCreateReloadDestroy) {
return Task.call(this::waitThenCallNewGetOrCreateReactInstanceTask, mBGExecutor)
.continueWithTask(Task::getResult);