You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add some highlighting to the various RR version code snippets and slightly streamlines wording
---------
Co-authored-by: Sigrid Huemer <[email protected]>
Copy file name to clipboardExpand all lines: docs/platforms/javascript/guides/react/features/react-router.mdx
+25-15Lines changed: 25 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -23,15 +23,15 @@ _(Available in version 7 and above)_
23
23
24
24
To use React Router v6 with Sentry:
25
25
26
-
Add `Sentry.reactRouterV6BrowserTracingIntegration` instead of the regular `Sentry.browserTracingIntegration` and provide the functions it needs to enable performance tracing:
26
+
Add `Sentry.reactRouterV6BrowserTracingIntegration` instead of the regular `Sentry.browserTracingIntegration` and provide the required React hooks and router functions:
27
27
28
28
-`useEffect` hook from `react`
29
29
-`useLocation` and `useNavigationType` hooks from `react-router-dom`
30
-
-`createRoutesFromChildren` and `matchRoutes` functions from `react-router-dom` or `react-router` packages.
30
+
-`createRoutesFromChildren` and `matchRoutes` functions from `react-router-dom` or `react-router` packages, depending on which package you're using.
31
31
32
32
<Alertlevel="warning">
33
33
34
-
Make sure `Sentry.reactRouterV6BrowserTracingIntegration` is initialized by your `Sentry.init` call, before you wrap `<Routes />` component or `useRoutes` hook. Otherwise, the routing instrumentation may not work properly.
34
+
Make sure you call `Sentry.init`, **before** you wrap your `<Routes />` component or the`useRoutes` hook. Otherwise, the routing instrumentation may not work properly.
35
35
36
36
</Alert>
37
37
@@ -43,8 +43,16 @@ If you choose to create your router instance with [`createBrowserRouter`](https:
0 commit comments