From d4951ddec6df8ecc6c9cc023aeae1933a9dbc59f Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Thu, 19 Dec 2024 14:34:31 +0100 Subject: [PATCH] update warning --- .../javascript/guides/react/features/react-router/v6.mdx | 7 +++++-- .../javascript/guides/react/features/react-router/v7.mdx | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) 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 dd7d8ad33507d..edadb950fbcfe 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 4fb5e03929e4d..6f7fd6a3ae752 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`