Skip to content

Commit f68030b

Browse files
committed
global obj
1 parent 3f3b5b9 commit f68030b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/react-router/src/client

packages/react-router/src/client/utils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { GLOBAL_OBJ } from '@sentry/core';
2+
13
/**
24
* Resolves a navigate argument to a pathname string.
35
*
@@ -18,5 +20,5 @@ export function resolveNavigateArg(target: unknown): string {
1820
}
1921

2022
// Object `to` without pathname - navigation stays on current path
21-
return (typeof window !== 'undefined' && window.location?.pathname) || '/';
23+
return (GLOBAL_OBJ as typeof GLOBAL_OBJ & Window).location?.pathname || '/';
2224
}

0 commit comments

Comments
 (0)