File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
ReactAndroid/src/main/java/com/facebook/react Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change 3939import com .facebook .react .bridge .WritableMap ;
4040import com .facebook .react .bridge .WritableNativeMap ;
4141import com .facebook .react .common .annotations .VisibleForTesting ;
42+ import com .facebook .react .config .ReactFeatureFlags ;
4243import com .facebook .react .modules .appregistry .AppRegistry ;
4344import com .facebook .react .modules .core .DeviceEventManagerModule ;
4445import com .facebook .react .modules .deviceinfo .DeviceInfoModule ;
@@ -437,13 +438,14 @@ public void unmountReactApplication() {
437438 // to be committed via the Scheduler, which will cause mounting instructions
438439 // to be queued up and synchronously executed to delete and remove
439440 // all the views in the hierarchy.
440- if (mReactInstanceManager != null ) {
441+ if (mReactInstanceManager != null && ReactFeatureFlags . enableStopSurfaceOnRootViewUnmount ) {
441442 final ReactContext reactApplicationContext = mReactInstanceManager .getCurrentReactContext ();
442443 if (reactApplicationContext != null && getUIManagerType () == FABRIC ) {
443444 @ Nullable
444445 UIManager uiManager =
445446 UIManagerHelper .getUIManager (reactApplicationContext , getUIManagerType ());
446447 if (uiManager != null ) {
448+ FLog .e (TAG , "stopSurface for surfaceId: " + this .getId ());
447449 uiManager .stopSurface (this .getId ());
448450 }
449451 }
Original file line number Diff line number Diff line change @@ -89,4 +89,7 @@ public class ReactFeatureFlags {
8989
9090 /** Feature flag to have FabricUIManager teardown stop all active surfaces. */
9191 public static boolean enableFabricStopAllSurfacesOnTeardown = false ;
92+
93+ /** Feature flag to use stopSurface when ReactRootView is unmounted. */
94+ public static boolean enableStopSurfaceOnRootViewUnmount = false ;
9295}
You can’t perform that action at this time.
0 commit comments