Files
pp-tcms/frontend/src/app/[locale]/error.tsx
Takeshi Kimata 1e01535134 i18n by next-intl
2024-05-03 11:44:02 +09:00

31 lines
512 B
TypeScript

"use client";
import { useEffect } from "react";
export default function Error({
error,
reset,
}: {
error: Error;
reset: () => void;
}) {
useEffect(() => {
// Log the error to an error reporting service
console.error(error);
}, [error]);
return (
<div>
<h2>Something went wrong!</h2>
<button
onClick={
// Attempt to recover by trying to re-render the segment
() => reset()
}
>
Try again
</button>
</div>
);
}