From 2c21efeb83feef18bbe344143fc63c6e202f5e88 Mon Sep 17 00:00:00 2001 From: Stephen Demjanenko Date: Tue, 6 Jul 2021 10:53:58 -0700 Subject: [PATCH] fix: allRoutes cannot triple equal a new array instance Running `===` against a newly instantiated array will always return false. Instead, we should check that `allRoutes` is empty. --- packages/react/src/reactrouter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/reactrouter.tsx b/packages/react/src/reactrouter.tsx index 3c52002edd79..ea1eac417924 100644 --- a/packages/react/src/reactrouter.tsx +++ b/packages/react/src/reactrouter.tsx @@ -65,7 +65,7 @@ function createReactRouterInstrumentation( } function getTransactionName(pathname: string): string { - if (allRoutes === [] || !matchPath) { + if (allRoutes.length === 0 || !matchPath) { return pathname; }