Skip to content

Commit b67dc69

Browse files
committed
feat(react): Drop support for React 15
1 parent fa4669a commit b67dc69

File tree

5 files changed

+13
-15
lines changed

5 files changed

+13
-15
lines changed

packages/gatsby/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
},
4646
"peerDependencies": {
4747
"gatsby": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0",
48-
"react": "15.x || 16.x || 17.x || 18.x"
48+
"react": "16.x || 17.x || 18.x"
4949
},
5050
"devDependencies": {
5151
"@testing-library/react": "^13.0.0",

packages/react/README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ To use this SDK, call `Sentry.init(options)` before you mount your React compone
2020

2121
```javascript
2222
import React from 'react';
23-
import ReactDOM from "react-dom";
23+
import ReactDOM from 'react-dom';
2424
import * as Sentry from '@sentry/react';
2525

2626
Sentry.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
4647
import React from 'react';
4748
import * as Sentry from '@sentry/react';
4849

4950
function FallbackComponent() {
50-
return (
51-
<div>An error has occured</div>
52-
)
51+
return <div>An error has occured</div>;
5352
}
5453

5554
class 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
7676
import React from 'react';
7777
import * 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

packages/react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"hoist-non-react-statics": "^3.3.2"
3737
},
3838
"peerDependencies": {
39-
"react": "15.x || 16.x || 17.x || 18.x"
39+
"react": "16.x || 17.x || 18.x"
4040
},
4141
"devDependencies": {
4242
"@testing-library/react": "^13.0.0",

packages/react/src/errorboundary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function setCause(error: Error & { cause?: Error }, cause: Error): void {
8989
}
9090

9191
/**
92-
* A ErrorBoundary component that logs errors to Sentry. Requires React >= 16.
92+
* A ErrorBoundary component that logs errors to Sentry.
9393
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the
9494
* Sentry React SDK ErrorBoundary caught an error invoking your application code. This
9595
* is expected behavior and NOT indicative of a bug with the Sentry React SDK.

packages/react/test/errorboundary.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -520,8 +520,6 @@ describe('ErrorBoundary', () => {
520520

521521
describe('isAtLeastReact17', () => {
522522
test.each([
523-
['React 15 with no patch', '15.0', false],
524-
['React 15 with no patch and no minor', '15.5', false],
525523
['React 16', '16.0.4', false],
526524
['React 17', '17.0.0', true],
527525
['React 17 with no patch', '17.4', true],

0 commit comments

Comments
 (0)