Skip to content

Commit 52314be

Browse files
authored
feat(react): Update docs to React 18 instructions (#6568)
1 parent f14360d commit 52314be

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/platform-includes/getting-started-config/javascript.react.mdx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
```javascript
2+
import { createRoot } from "react-dom/client";
23
import React from "react";
3-
import ReactDOM from "react-dom";
44
import * as Sentry from "@sentry/react";
55
import App from "./App";
66

@@ -13,10 +13,9 @@ Sentry.init({
1313
tracesSampleRate: 1.0,
1414
});
1515

16-
ReactDOM.render(<App />, document.getElementById("root"));
17-
18-
// Can also use with React Concurrent Mode
19-
// ReactDOM.createRoot(document.getElementById('root')).render(<App />);
16+
const container = document.getElementById(“app”);
17+
const root = createRoot(container);
18+
root.render(<App />);
2019
```
2120

2221
Once this is done, all unhandled exceptions are automatically captured by Sentry.

src/wizard/javascript/react/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ npm install --save @sentry/react
2626
Initialize Sentry as early as possible in your application's lifecycle.
2727

2828
```javascript
29-
import { createRoot } React from "react-dom/client";
29+
import { createRoot } from "react-dom/client";
3030
import React from "react";
3131
import * as Sentry from "@sentry/react";
3232
import App from "./App";
@@ -39,7 +39,7 @@ Sentry.init({
3939

4040
const container = document.getElementById(“app”);
4141
const root = createRoot(container);
42-
root.render(<App />)
42+
root.render(<App />);
4343
```
4444

4545
> **tracesSampleRate: 1.0**
@@ -59,4 +59,4 @@ return <button onClick={() => methodDoesNotExist()}>Break the world</button>;
5959

6060
- [Source Maps](https://docs.sentry.io/platforms/javascript/guides/react/sourcemaps/): Learn how to enable readable stack traces in your Sentry errors.
6161
- [React Features](https://docs.sentry.io/platforms/javascript/guides/react/features/): Learn about our first class integration with the React framework.
62-
- [Session Replay](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/): Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.
62+
- [Session Replay](https://docs.sentry.io/platforms/javascript/guides/react/session-replay/): Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.

0 commit comments

Comments
 (0)