@@ -268,11 +268,6 @@ private void loadBundle() {
268268 @ Override
269269 public void run () {
270270 try {
271- // We don't need to resetReactRootViews anymore
272- // due the issue https://github.com/facebook/react-native/issues/14533
273- // has been fixed in RN 0.46.0
274- //resetReactRootViews(instanceManager);
275-
276271 instanceManager .recreateReactContextInBackground ();
277272 mCodePush .initializeUpdateAfterRestart ();
278273 } catch (Exception e ) {
@@ -312,20 +307,6 @@ private boolean isLiveReloadEnabled(DevSupportManager devSupportManager) {
312307 return false ;
313308 }
314309
315- // This workaround has been implemented in order to fix https://github.com/facebook/react-native/issues/14533
316- // resetReactRootViews allows to call recreateReactContextInBackground without any exceptions
317- // This fix also relates to https://github.com/microsoft/react-native-code-push/issues/878
318- private void resetReactRootViews (ReactInstanceManager instanceManager ) throws NoSuchFieldException , IllegalAccessException {
319- Field mAttachedRootViewsField = instanceManager .getClass ().getDeclaredField ("mAttachedRootViews" );
320- mAttachedRootViewsField .setAccessible (true );
321- List <ReactRootView > mAttachedRootViews = (List <ReactRootView >) mAttachedRootViewsField .get (instanceManager );
322- for (ReactRootView reactRootView : mAttachedRootViews ) {
323- reactRootView .removeAllViews ();
324- reactRootView .setId (View .NO_ID );
325- }
326- mAttachedRootViewsField .set (instanceManager , mAttachedRootViews );
327- }
328-
329310 private void clearLifecycleEventListener () {
330311 // Remove LifecycleEventListener to prevent infinite restart loop
331312 if (mLifecycleEventListener != null ) {
0 commit comments