Browse Source

Detach ReactRootViews properly on reload

Guy Carmeli 8 years ago
parent
commit
21e3f3fa1b

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/views/RctView.java View File

@@ -73,6 +73,10 @@ public class RctView extends FrameLayout {
73 73
                 }
74 74
             };
75 75
 
76
+    public void detachReactRootView(ReactInstanceManager reactInstanceManager) {
77
+        reactInstanceManager.detachRootView(reactRootView);
78
+    }
79
+
76 80
     /**
77 81
      * Interface used to run some code when the {@link ReactRootView} is visible.
78 82
      */

+ 1
- 1
android/app/src/main/java/com/reactnativenavigation/views/ScreenStack.java View File

@@ -172,7 +172,7 @@ public class ScreenStack extends android.support.design.widget.CoordinatorLayout
172 172
             // Ensure view will be properly detached and unmounted
173 173
             view.onRemoveFromScreen();
174 174
             // Unmount the view
175
-            view.detachFromScreen();
175
+            view.detachReactRootView(mReactInstanceManager);
176 176
         }
177 177
         removeAllViews();
178 178
     }