Skip to content

Commit

Permalink
feat: in global error get locale in params and set in html lang attri…
Browse files Browse the repository at this point in the history
…bute
  • Loading branch information
ixartz committed Dec 20, 2023
1 parent 4bf9503 commit c3b4d25
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/global-error.tsx
Expand Up @@ -6,15 +6,17 @@ import { useEffect } from 'react';

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

return (
<html lang="en">
<html lang={locale}>
<body>
{/* This is the default Next.js error component but it doesn't allow omitting the statusCode property yet. */}
<Error statusCode={undefined as any} />
Expand Down

0 comments on commit c3b4d25

Please sign in to comment.