Skip to content

Commit

Permalink
fix(docs): add an additional check for active element + href
Browse files Browse the repository at this point in the history
  • Loading branch information
realdreamer committed Aug 22, 2023
1 parent 2306a29 commit 5e83fa0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/apps/docs/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ export const MyApp = ({

const handleBeforeUnload = (event: BeforeUnloadEvent): void => {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const { href } = (event as any).originalTarget.activeElement;
const { href } = (event as any).originalTarget?.activeElement || {};

if (!href) return;

onExternalButtonClick(href);
};

Expand Down

0 comments on commit 5e83fa0

Please sign in to comment.