mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
fix-next: undefined root view when reapplying styles (#6729)
* fix: undefined root view when reapplying styles Error: ``` JS ERROR TypeError: undefined is not an object (evaluating 'application_1.getRootView()._onCssStateChange') ``` Steps: - `tns run <platform> --hmr` - make a change in application styles - restart the application
This commit is contained in:
@@ -89,8 +89,9 @@ export function livesync(context?: HmrContext) {
|
||||
reapplyAppCss = extensions.some(ext => context.module === fileName.concat(ext));
|
||||
}
|
||||
|
||||
if (reapplyAppCss) {
|
||||
getRootView()._onCssStateChange();
|
||||
const rootView = getRootView();
|
||||
if (reapplyAppCss && rootView) {
|
||||
rootView._onCssStateChange();
|
||||
} else if (liveSyncCore) {
|
||||
liveSyncCore();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user