8000 fix(react): allRoutes cannot triple equal a new array instance (#3779) · jcomo/sentry-javascript@f398340 · GitHub
[go: up one dir, main page]

Skip to content

Commit f398340

Browse files
authored
fix(react): allRoutes cannot triple equal a new array instance (getsentry#3779)
Running `===` against a newly instantiated array will always return false. Instead, we should check that `allRoutes` is empty.
1 parent 8bd8243 commit f398340

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react/src/reactrouter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function createReactRouterInstrumentation(
6565
}
6666

6767
function getTransactionName(pathname: string): string {
68-
if (allRoutes === [] || !matchPath) {
68+
if (allRoutes.length === 0 || !matchPath) {
6969
return pathname;
7070
}
7171

0 commit comments

Comments
 (0)
0