Skip to content

Commit 213e298

Browse files
committed
update tabs + note on v7 framework mode
1 parent 395fb0e commit 213e298

File tree

1 file changed

+11
-10
lines changed
  • docs/platforms/javascript/guides/react/features/react-router

1 file changed

+11
-10
lines changed

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ sidebar_order: 20
55
---
66

77
<Alert level="info">
8-
React Router v6 support is included in the `@sentry/react` package since version `7`.
9-
React Router v7 support is included in the `@sentry/react` package since version `8.42.0`.
8+
- React Router v6 support is included in the `@sentry/react` package since version `7`.
9+
- React Router v7 support is included in the `@sentry/react` package since version `8.42.0`.
10+
- React Router v7 in framework mode is not yet supported.
1011
</Alert>
1112

1213
Update your `Sentry.browserTracingIntegration` to `Sentry.reactRouterV{6|7}BrowserTracingIntegration` and provide the required React hooks and router functions:
@@ -30,7 +31,7 @@ For React Router v6 this is available in `@sentry/react` version `7.21.0` and ab
3031
If you choose to create your router instance with [`createBrowserRouter`](https://reactrouter.com/en/main/routers/create-browser-router) from the `react-router-dom` package, you can use `Sentry.wrapCreateBrowserRouterV{6|7}` to wrap it with the instrumentation:
3132

3233

33-
```javascript {2-8, 15-21, 26-33} {tabTitle: v6}
34+
```javascript {2-8, 15-21, 26-33} {tabTitle: Version 6}
3435
import React from "react";
3536
import {
3637
createBrowserRouter,
@@ -64,7 +65,7 @@ const router = sentryCreateBrowserRouter([
6465
]);
6566
```
6667

67-
```javascript {2-8, 15-21, 26-33} {tabTitle: v7}
68+
```javascript {2-8, 15-21, 26-33} {tabTitle: Version 7}
6869
import React from "react";
6970
import {
7071
createBrowserRouter,
@@ -110,7 +111,7 @@ You can instrument [`createMemoryRouter`](https://reactrouter.com/en/main/router
110111
If you're using the `<Routes />` component to define your routes, wrap [`Routes`](https://reactrouter.com/en/main/components/routes) using `Sentry.withSentryReactRouterV{6|7}Routing`. This creates a higher order component, which will enable Sentry to reach your router context. You can also use `Sentry.withSentryReactRouterV{6|7}Routing` for `Routes` inside `BrowserRouter`. `MemoryRouter`, and `HashRouter` components:
111112

112113

113-
```javascript {3-11, 18-24, 29, 33-35} {tabTitle: v6}
114+
```javascript {3-11, 18-24, 29, 33-35} {tabTitle: Version 6}
114115
import React from "react";
115116
import ReactDOM from "react-dom";
116117
import {
@@ -150,7 +151,7 @@ ReactDOM.render(
150151
);
151152
```
152153

153-
```javascript {3-11, 18-24, 29, 33-35} {tabTitle: v7}
154+
```javascript {3-11, 18-24, 29, 33-35} {tabTitle: Version 7}
154155
import React from "react";
155156
import ReactDOM from "react-dom";
156157
import {
@@ -207,7 +208,7 @@ If you specify your route definitions as an object to the [`useRoutes` hook](htt
207208
</Alert>
208209

209210

210-
```javascript {2-10, 15-21, 26, 29-31} {tabTitle: v6}
211+
```javascript {2-10, 15-21, 26, 29-31} {tabTitle: Version 6}
211212
import React from "react";
212213
import {
213214
createRoutesFromChildren,
@@ -249,7 +250,7 @@ ReactDOM.render(
249250
);
250251
```
251252

252-
```javascript {2-10, 15-21, 26, 29-31} {tabTitle: v7}
253+
```javascript {2-10, 15-21, 26, 29-31} {tabTitle: Version 7}
253254
import React from "react";
254255
import {
255256
createRoutesFromChildren,
@@ -304,7 +305,7 @@ Note, that this only applies to render method and lifecycle errors since React d
304305

305306
To send errors to Sentry while using a custom error boundary, use the `Sentry.captureException` method:
306307

307-
```jsx {11, 28} {tabTitle: v6}
308+
```jsx {11, 28} {tabTitle: Version 6}
308309
// router setup
309310
const sentryCreateBrowserRouter = wrapCreateBrowserRouterV6(createBrowserRouter);
310311
const router = sentryCreateBrowserRouter([
@@ -344,7 +345,7 @@ export function YourCustomRootErrorBoundary() {
344345

345346
```
346347

347-
```jsx {11, 28} {tabTitle: v7}
348+
```jsx {11, 28} {tabTitle: Version 7}
348349
// router setup
349350
const sentryCreateBrowserRouter = wrapCreateBrowserRouterV7(createBrowserRouter);
350351
const router = sentryCreateBrowserRouter([

0 commit comments

Comments
 (0)