Skip to content

Commit c0dabd9

Browse files
lforstandreiborza
authored andcommitted
fix(react): Set dependency-injected functions as early as possible (#12019)
1 parent bdf12ef commit c0dabd9

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

packages/react/src/reactrouterv6.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,14 @@ export function reactRouterV6BrowserTracingIntegration(
8484

8585
return {
8686
...integration,
87+
setup() {
88+
_useEffect = useEffect;
89+
_useLocation = useLocation;
90+
_useNavigationType = useNavigationType;
91+
_matchRoutes = matchRoutes;
92+
_createRoutesFromChildren = createRoutesFromChildren;
93+
_stripBasename = stripBasename || false;
94+
},
8795
afterAllSetup(client) {
8896
integration.afterAllSetup(client);
8997

@@ -99,13 +107,6 @@ export function reactRouterV6BrowserTracingIntegration(
99107
});
100108
}
101109

102-
_useEffect = useEffect;
103-
_useLocation = useLocation;
104-
_useNavigationType = useNavigationType;
105-
_matchRoutes = matchRoutes;
106-
_createRoutesFromChildren = createRoutesFromChildren;
107-
_stripBasename = stripBasename || false;
108-
109110
if (instrumentNavigation) {
110111
CLIENTS_WITH_INSTRUMENT_NAVIGATION.push(client);
111112
}

0 commit comments

Comments
 (0)