diff --git a/docs/platforms/javascript/guides/react/features/react-router/v6.mdx b/docs/platforms/javascript/guides/react/features/react-router/v6.mdx index dd7d8ad33507dc..edadb950fbcfe2 100644 --- a/docs/platforms/javascript/guides/react/features/react-router/v6.mdx +++ b/docs/platforms/javascript/guides/react/features/react-router/v6.mdx @@ -16,7 +16,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV6BrowserTr -Make sure you call `Sentry.init`, **before** you wrap your `` 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 `` component +- Using `useRoutes` +- Using `createBrowserRouterV6` @@ -56,7 +59,7 @@ Sentry.init({ }); const sentryCreateBrowserRouter = - Sentry.wrapCreateBrowserRouter(createBrowserRouter); + Sentry.wrapCreateBrowserRouterV6(createBrowserRouter); const router = sentryCreateBrowserRouter([ // your routes... diff --git a/docs/platforms/javascript/guides/react/features/react-router/v7.mdx b/docs/platforms/javascript/guides/react/features/react-router/v7.mdx index 4fb5e03929e4de..6f7fd6a3ae752b 100644 --- a/docs/platforms/javascript/guides/react/features/react-router/v7.mdx +++ b/docs/platforms/javascript/guides/react/features/react-router/v7.mdx @@ -17,7 +17,10 @@ Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV7BrowserTr -Make sure you call `Sentry.init`, **before** you wrap your `` 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 `` component +- Using `useRoutes` +- Using `createBrowserRouterV7`