diff --git a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx
index 48b293c215453..90442292558ae 100644
--- a/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx
+++ b/docs/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router.mdx
@@ -115,12 +115,14 @@ startTransition(() => {
hydrateRoot(
document,
-
+
);
});
```
+The `sentryOnError` handler integrates with React Router's [`onError` hook](https://reactrouter.com/how-to/error-reporting) to automatically capture and report client-side errors to Sentry.
+
### Configure Server-side Sentry
First, create an `instrument.server.mjs` file to initialize Sentry on the server:
diff --git a/docs/platforms/javascript/guides/react-router/manual-setup.mdx b/docs/platforms/javascript/guides/react-router/manual-setup.mdx
index 9bfe4bc96a085..3bb04159d3e95 100644
--- a/docs/platforms/javascript/guides/react-router/manual-setup.mdx
+++ b/docs/platforms/javascript/guides/react-router/manual-setup.mdx
@@ -151,53 +151,13 @@ startTransition(() => {
hydrateRoot(
document,
-
+
);
});
```
-#### Report Errors from Error Boundaries
-
-Update your `app/root.tsx` file to capture unhandled errors in your error boundary:
-
-```tsx {diff} {filename: app/root.tsx}
-+import * as Sentry from "@sentry/react-router";
-
-export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {
- let message = "Oops!";
- let details = "An unexpected error occurred.";
- let stack: string | undefined;
-
- if (isRouteErrorResponse(error)) {
- message = error.status === 404 ? "404" : "Error";
- details =
- error.status === 404
- ? "The requested page could not be found."
- : error.statusText || details;
- } else if (error && error instanceof Error) {
- // you only want to capture non 404-errors that reach the boundary
-+ Sentry.captureException(error);
- if (import.meta.env.DEV) {
- details = error.message;
- stack = error.stack;
- }
- }
-
- return (
-
- {message}
- {details}
- {stack && (
-
- {stack}
-
- )}
-
- );
-}
-// ...
-```
+The `sentryOnError` handler integrates with React Router's [`onError` hook](https://reactrouter.com/how-to/error-reporting) to automatically capture and report client-side errors to Sentry.
### Configure Server-side Sentry