Skip to content

Commit 496372d

Browse files
jasonadenkara
authored andcommitted
fix(router): remove type bludgeoning of context and outlet when running CanDeactivate (#26496)
Fixes #18253 PR Close #26496
1 parent e9e804f commit 496372d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/router/src/utils/preactivation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,8 @@ function getRouteGuards(
121121
}
122122

123123
if (shouldRun) {
124-
const outlet = context !.outlet !;
125-
checks.canDeactivateChecks.push(new CanDeactivate(outlet.component, curr));
124+
const component = context && context.outlet && context.outlet.component || null;
125+
checks.canDeactivateChecks.push(new CanDeactivate(component, curr));
126126
}
127127
} else {
128128
if (curr) {

0 commit comments

Comments
 (0)