mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Feature-flag gate stopSurface on root view unmount
Summary: Gate stopSurface behind a feature flag. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D22054480 fbshipit-source-id: 3ea48ab46aeb3532fc7a3dd83659d7c32891ec06
This commit is contained in:
committed by
Facebook GitHub Bot
parent
33ed358330
commit
b69041f086
@@ -39,6 +39,7 @@ import com.facebook.react.bridge.UiThreadUtil;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.bridge.WritableNativeMap;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.react.config.ReactFeatureFlags;
|
||||
import com.facebook.react.modules.appregistry.AppRegistry;
|
||||
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||
import com.facebook.react.modules.deviceinfo.DeviceInfoModule;
|
||||
@@ -437,13 +438,14 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
|
||||
// to be committed via the Scheduler, which will cause mounting instructions
|
||||
// to be queued up and synchronously executed to delete and remove
|
||||
// all the views in the hierarchy.
|
||||
if (mReactInstanceManager != null) {
|
||||
if (mReactInstanceManager != null && ReactFeatureFlags.enableStopSurfaceOnRootViewUnmount) {
|
||||
final ReactContext reactApplicationContext = mReactInstanceManager.getCurrentReactContext();
|
||||
if (reactApplicationContext != null && getUIManagerType() == FABRIC) {
|
||||
@Nullable
|
||||
UIManager uiManager =
|
||||
UIManagerHelper.getUIManager(reactApplicationContext, getUIManagerType());
|
||||
if (uiManager != null) {
|
||||
FLog.e(TAG, "stopSurface for surfaceId: " + this.getId());
|
||||
uiManager.stopSurface(this.getId());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user