Skip to content

Commit

Permalink
yarn fix and stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiPrasad committed May 24, 2024
1 parent 2550dac commit 0ba4bcd
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement,
root.render(
<div>
<Index />
</div>
</div>,
);
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ const Index = () => {
);
};

function Throw({error}) {
function Throw({ error }) {
throw new Error(`${error} error`);
}

class SampleErrorBoundary extends React.Component {
constructor(props) {
super(props);
this.state = {error: null};
this.state = { error: null };
}

componentDidCatch(error, errorInfo) {
this.setState({error});
this.setState({ error });
// no-op
}

Expand Down
6 changes: 4 additions & 2 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ root.render(<App />);

### React 19

Starting with React 19, the `createRoot` and `hydrateRoot` methods expose error hooks that can be used to capture errors automatically. Use the `Sentry.reactErrorHandler` function to capture errors in the error hooks you are interested in.
Starting with React 19, the `createRoot` and `hydrateRoot` methods expose error hooks that can be used to capture errors
automatically. Use the `Sentry.reactErrorHandler` function to capture errors in the error hooks you are interested in.

```js
const container = document.getElementById(“app”);
Expand All @@ -59,7 +60,8 @@ const root = createRoot(container, {
root.render(<App />);
```

If you want more finely grained control over error handling, we recommend only adding the `onUncaughtError` and `onRecoverableError` hooks and using an `ErrorBoundary` component instead of the `onCaughtError` hook.
If you want more finely grained control over error handling, we recommend only adding the `onUncaughtError` and
`onRecoverableError` hooks and using an `ErrorBoundary` component instead of the `onCaughtError` hook.

### ErrorBoundary

Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@types/history-5": "npm:@types/history@4.7.8",
"@types/hoist-non-react-statics": "^3.3.1",
"@types/node-fetch": "^2.6.0",
"@types/react": "^17.0.3",
"@types/react": "^18.0.0",
"@types/react-router-3": "npm:@types/react-router@3.0.24",
"@types/react-router-4": "npm:@types/react-router@5.1.14",
"@types/react-router-5": "npm:@types/react-router@5.1.14",
Expand All @@ -67,8 +67,8 @@
"history-4": "npm:history@4.6.0",
"history-5": "npm:history@4.9.0",
"node-fetch": "^2.6.0",
"react": "19@rc",
"react-dom": "19@rc",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-3": "npm:react-router@3.2.0",
"react-router-4": "npm:react-router@4.1.0",
"react-router-5": "npm:react-router@5.0.0",
Expand Down
36 changes: 21 additions & 15 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8840,7 +8840,7 @@
dependencies:
"@types/react" "*"

"@types/react@*", "@types/react@>=16.9.0", "@types/react@^17.0.3":
"@types/react@*", "@types/react@>=16.9.0":
version "17.0.3"
resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.3.tgz#ba6e215368501ac3826951eef2904574c262cc79"
integrity sha512-wYOUxIgs2HZZ0ACNiIayItyluADNbONl7kt8lkLjVK8IitMH5QMyAh75Fwhmo37r1m7L2JaFj03sIfxBVDvRAg==
Expand All @@ -8849,6 +8849,14 @@
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/react@^18.0.0":
version "18.3.3"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.3.3.tgz#9679020895318b0915d7a3ab004d92d33375c45f"
integrity sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==
dependencies:
"@types/prop-types" "*"
csstype "^3.0.2"

"@types/resolve@1.17.1":
version "1.17.1"
resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6"
Expand Down Expand Up @@ -26045,12 +26053,13 @@ rc@^1.2.7, rc@^1.2.8:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-dom@19@rc:
version "19.0.0-rc-f994737d14-20240522"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.0.0-rc-f994737d14-20240522.tgz#992710eeed9ccc7546fd258745cff1e04a3f8659"
integrity sha512-J4CsfTSptPKkhaPbaR6n/KohQiHZTrRZ8GL4H8rbAqN/Qpy69g2MIoLBr5/PUX21ye6JxC1ZRWJFna7Xdg1pdA==
react-dom@^18.0.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4"
integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==
dependencies:
scheduler "0.25.0-rc-f994737d14-20240522"
loose-envify "^1.1.0"
scheduler "^0.23.2"

react-error-boundary@^3.1.0:
version "3.1.1"
Expand Down Expand Up @@ -26139,11 +26148,6 @@ react-router-dom@^6.2.2:
history "^5.2.0"
react-router "6.3.0"

react@19@rc:
version "19.0.0-rc-f994737d14-20240522"
resolved "https://registry.yarnpkg.com/react/-/react-19.0.0-rc-f994737d14-20240522.tgz#b400d554859940e9f4b8b6db1fd2537bd822bcc9"
integrity sha512-SeU2v5Xy6FotVhKz0pMS2gvYP7HlkF0qgTskj3JzA1vlxcb3dQjxlm9t0ZlJqcgoyI3VFAw7bomuDMdgy1nBuw==

react@^18.0.0:
version "18.0.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.0.0.tgz#b468736d1f4a5891f38585ba8e8fb29f91c3cb96"
Expand Down Expand Up @@ -27353,10 +27357,12 @@ saxes@^6.0.0:
dependencies:
xmlchars "^2.2.0"

scheduler@0.25.0-rc-f994737d14-20240522:
version "0.25.0-rc-f994737d14-20240522"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.25.0-rc-f994737d14-20240522.tgz#6bbdbf50adeb250035a26f082bf966077d264a7e"
integrity sha512-qS+xGFF7AljP2APO2iJe8zESNsK20k25MACz+WGOXPybUsRdi1ssvaoF93im2nSX2q/XT3wKkjdz6RQfbmaxdw==
scheduler@^0.23.2:
version "0.23.2"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3"
integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==
dependencies:
loose-envify "^1.1.0"

schema-utils@^1.0.0:
version "1.0.0"
Expand Down

0 comments on commit 0ba4bcd

Please sign in to comment.