Skip to content

Commit d4951dd

Browse files
committed
update warning
1 parent 99016ee commit d4951dd

File tree

2 files changed

+9
-3
lines changed
  • docs/platforms/javascript/guides/react/features/react-router

2 files changed

+9
-3
lines changed

docs/platforms/javascript/guides/react/features/react-router/v6.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV6BrowserTr
1616

1717
<Alert level="warning">
1818

19-
Make sure you call `Sentry.init`, **before** you wrap your `<Routes />` component or the `useRoutes` hook. Otherwise, the routing instrumentation may not work properly.
19+
To ensure proper routing instrumentation, initialize Sentry by calling `Sentry.init` **before**:
20+
- Wrapping your `<Routes />` component
21+
- Using `useRoutes`
22+
- Using `createBrowserRouterV6`
2023

2124
</Alert>
2225

@@ -56,7 +59,7 @@ Sentry.init({
5659
});
5760

5861
const sentryCreateBrowserRouter =
59-
Sentry.wrapCreateBrowserRouter(createBrowserRouter);
62+
Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);
6063

6164
const router = sentryCreateBrowserRouter([
6265
// your routes...

docs/platforms/javascript/guides/react/features/react-router/v7.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV7BrowserTr
1717

1818
<Alert level="warning">
1919

20-
Make sure you call `Sentry.init`, **before** you wrap your `<Routes />` component or the `useRoutes` hook. Otherwise, the routing instrumentation may not work properly.
20+
To ensure proper routing instrumentation, initialize Sentry by calling `Sentry.init` **before**:
21+
- Wrapping your `<Routes />` component
22+
- Using `useRoutes`
23+
- Using `createBrowserRouterV7`
2124

2225
</Alert>
2326

0 commit comments

Comments
 (0)