浏览代码

Detach ReactRootViews properly on reload

Guy Carmeli 9 年前
父节点
当前提交
21e3f3fa1b

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/views/RctView.java 查看文件

73
                 }
73
                 }
74
             };
74
             };
75
 
75
 
76
+    public void detachReactRootView(ReactInstanceManager reactInstanceManager) {
77
+        reactInstanceManager.detachRootView(reactRootView);
78
+    }
79
+
76
     /**
80
     /**
77
      * Interface used to run some code when the {@link ReactRootView} is visible.
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 查看文件

172
             // Ensure view will be properly detached and unmounted
172
             // Ensure view will be properly detached and unmounted
173
             view.onRemoveFromScreen();
173
             view.onRemoveFromScreen();
174
             // Unmount the view
174
             // Unmount the view
175
-            view.detachFromScreen();
175
+            view.detachReactRootView(mReactInstanceManager);
176
         }
176
         }
177
         removeAllViews();
177
         removeAllViews();
178
     }
178
     }