Parcourir la source

Detach ReactRootViews properly on reload

Guy Carmeli il y a 8 ans
Parent
révision
21e3f3fa1b

+ 4
- 0
android/app/src/main/java/com/reactnativenavigation/views/RctView.java Voir le fichier

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 Voir le fichier

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
     }