@@ -20,7 +20,7 @@ To use this SDK, call `Sentry.init(options)` before you mount your React compone
2020
2121``` javascript
2222import React from ' react' ;
23- import ReactDOM from " react-dom" ;
23+ import ReactDOM from ' react-dom' ;
2424import * as Sentry from ' @sentry/react' ;
2525
2626Sentry .init ({
@@ -39,17 +39,16 @@ ReactDOM.render(<App />, rootNode);
3939### ErrorBoundary
4040
4141` @sentry/react ` exports an ErrorBoundary component that will automatically send Javascript errors from inside a
42- component tree to Sentry, and set a fallback UI. Requires React version >= 16.
42+ component tree to Sentry, and set a fallback UI.
4343
4444> app.js
45+
4546``` javascript
4647import React from ' react' ;
4748import * as Sentry from ' @sentry/react' ;
4849
4950function FallbackComponent () {
50- return (
51- < div> An error has occured< / div>
52- )
51+ return < div> An error has occured< / div> ;
5352}
5453
5554class App extends React .Component {
@@ -58,7 +57,7 @@ class App extends React.Component {
5857 < Sentry .ErrorBoundary fallback= {FallbackComponent} showDialog>
5958 < OtherComponents / >
6059 < / Sentry .ErrorBoundary >
61- )
60+ );
6261 }
6362}
6463
@@ -67,11 +66,12 @@ export default App;
6766
6867### Profiler
6968
70- ` @sentry/react ` exports a Profiler component that leverages the tracing features to add React-related
71- spans to transactions. If tracing is not enabled, the Profiler component will not work. The Profiler
72- tracks component mount, render duration and updates. Requires React version >= 15 .
69+ ` @sentry/react ` exports a Profiler component that leverages the tracing features to add React-related spans to
70+ transactions. If tracing is not enabled, the Profiler component will not work. The Profiler tracks component mount,
71+ render duration and updates.
7372
7473> app.js
74+
7575``` javascript
7676import React from ' react' ;
7777import * as Sentry from ' @sentry/react' ;
@@ -83,7 +83,7 @@ class App extends React.Component {
8383 < InsideComponent someProp= {2 } / >
8484 < AnotherComponent / >
8585 < / FancyComponent>
86- )
86+ );
8787 }
8888}
8989
0 commit comments