Skip to content

Commit bd8e1b8

Browse files
authored
fix(application): explicitly pass rootView to initRootView (#10345)
fixes occasional crashes when resuming the app.
1 parent 6effd55 commit bd8e1b8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

packages/core/application/application-common.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,8 @@ export class ApplicationCommon {
364364
// rest of implementation is platform specific
365365
}
366366

367-
initRootView() {
368-
this.setRootViewCSSClasses(this.getRootView());
367+
initRootView(rootView: View) {
368+
this.setRootViewCSSClasses(rootView);
369369
initAccessibilityCssHelper();
370370
initAccessibilityFontScale();
371371
}

packages/core/application/application.ios.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class iOSApplication extends ApplicationCommon implements IiOSApplication
157157
visibleVC.presentViewControllerAnimatedCompletion(controller, true, null);
158158
}
159159

160-
this.initRootView();
160+
this.initRootView(rootView);
161161
this.notifyAppStarted();
162162
}
163163

@@ -349,7 +349,7 @@ export class iOSApplication extends ApplicationCommon implements IiOSApplication
349349
this._window.makeKeyAndVisible();
350350
}
351351

352-
this.initRootView();
352+
this.initRootView(rootView);
353353

354354
rootView.on(IOSHelper.traitCollectionColorAppearanceChangedEvent, () => {
355355
const userInterfaceStyle = controller.traitCollection.userInterfaceStyle;

packages/core/ui/frame/index.android.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1378,7 +1378,7 @@ class ActivityCallbacksImplementation implements AndroidActivityCallbacks {
13781378
this._rootView = rootView;
13791379

13801380
// sets root classes once rootView is ready...
1381-
Application.initRootView();
1381+
Application.initRootView(rootView);
13821382
}
13831383
}
13841384

0 commit comments

Comments
 (0)