Skip to content

Commit

Permalink
docs(react): Update warning on react router library docs (#12189)
Browse files Browse the repository at this point in the history
  • Loading branch information
chargome authored Dec 20, 2024
1 parent 7d2082a commit fb6c22e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV6BrowserTr

<Alert level="warning">

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

</Alert>

Expand Down Expand Up @@ -56,7 +59,7 @@ Sentry.init({
});

const sentryCreateBrowserRouter =
Sentry.wrapCreateBrowserRouter(createBrowserRouter);
Sentry.wrapCreateBrowserRouterV6(createBrowserRouter);

const router = sentryCreateBrowserRouter([
// your routes...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV7BrowserTr

<Alert level="warning">

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

</Alert>

Expand Down

0 comments on commit fb6c22e

Please sign in to comment.