@@ -166,7 +166,7 @@ public void run() {
166
166
throw new NoSuchMethodException ("ReactDelegate doesn't have reload method in RN < 0.74" );
167
167
}
168
168
169
- resetReactRootViewsIfDebug ( instanceManager , reactDelegate );
169
+ resetReactRootViews ( reactDelegate );
170
170
171
171
Method reloadMethod = reactDelegate .getClass ().getMethod ("reload" );
172
172
reloadMethod .invoke (reactDelegate );
@@ -191,20 +191,17 @@ public void run() {
191
191
}
192
192
}
193
193
194
- // Fix freezing that occurs when reloading the app in debug mode (RN >= 0.77.1 Old Architecture)
194
+ // Fix freezing that occurs when reloading the app (RN >= 0.77.1 Old Architecture)
195
195
// - "Trying to add a root view with an explicit id (11) already set.
196
196
// React Native uses the id field to track react tags and will overwrite this field.
197
197
// If that is fine, explicitly overwrite the id field to View.NO_ID before calling addRootView."
198
- private void resetReactRootViewsIfDebug (ReactInstanceManager instanceManager , ReactDelegate reactDelegate ) {
199
- DevSupportManager devSupportManager = instanceManager .getDevSupportManager ();
200
- if (devSupportManager .getDevSupportEnabled ()) {
201
- ReactActivity currentActivity = (ReactActivity ) getCurrentActivity ();
202
- if (currentActivity != null ) {
203
- ReactRootView reactRootView = reactDelegate .getReactRootView ();
204
- if (reactRootView != null ) {
205
- reactRootView .removeAllViews ();
206
- reactRootView .setId (View .NO_ID );
207
- }
198
+ private void resetReactRootViews (ReactDelegate reactDelegate ) {
199
+ ReactActivity currentActivity = (ReactActivity ) getCurrentActivity ();
200
+ if (currentActivity != null ) {
201
+ ReactRootView reactRootView = reactDelegate .getReactRootView ();
202
+ if (reactRootView != null ) {
203
+ reactRootView .removeAllViews ();
204
+ reactRootView .setId (View .NO_ID );
208
205
}
209
206
}
210
207
}
0 commit comments