Skip to content

Commit

Permalink
docs(nextjs): Update Next.js GlobalError prop type
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d committed Jun 18, 2024
1 parent 2057f71 commit ae62b1f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions docs/platforms/javascript/guides/nextjs/manual-setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -175,20 +175,16 @@ import * as Sentry from "@sentry/nextjs";
import NextError from "next/error";
import { useEffect } from "react";

export default function GlobalError({
error,
}: {
error: Error & { digest?: string };
}) {
export default function GlobalError({ error }: { error: Error & { digest?: string } }) {
useEffect(() => {
Sentry.captureException(error);
}, [error]);

return (
<html>
<body>
{/* This is the default Next.js error component but it doesn't allow omitting the statusCode property yet. */}
<NextError statusCode={undefined as any} />
{/* Passing `0` as `statusCode` as the type has to be a number, but we do not get a status code here. */}
<NextError statusCode={0} />
</body>
</html>
);
Expand Down

0 comments on commit ae62b1f

Please sign in to comment.