Skip to content

Commit 9817f85

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Avoid cleaning up ReactRootView content when reactContext is destroyed
Summary: This diff avoids deleting all the views of ReactRootView when the ReactContext is destroyed (ONLY FOR FABRIC). In Fabric these views are removed and deleted by the framework when the ReactShadowNode is destroyed. Reviewed By: shergin Differential Revision: D10319737 fbshipit-source-id: 2e2d2599006cd8205e0153c18cd75383387ce1df
1 parent 5d41466 commit 9817f85

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,11 @@ private void tearDownReactContext(ReactContext reactContext) {
10731073

10741074
synchronized (mAttachedRootViews) {
10751075
for (ReactRootView rootView : mAttachedRootViews) {
1076-
rootView.removeAllViews();
1076+
if (rootView.getUIManagerType() != FABRIC) {
1077+
// All the views created in surfaces that are managed by Fabric, are removed and deleted
1078+
// by the Mounting Layer.
1079+
rootView.removeAllViews();
1080+
}
10771081
rootView.setId(View.NO_ID);
10781082
}
10791083
}

0 commit comments

Comments
 (0)