5.3 글로벌 로딩/스켈레톤/에러 경계 패턴 정립 o

This commit is contained in:
koreacomp5
2025-10-09 15:33:01 +09:00
parent 563b162290
commit ca8fdc4fba
4 changed files with 55 additions and 1 deletions

17
src/app/error.tsx Normal file
View File

@@ -0,0 +1,17 @@
"use client";
import { useEffect } from "react";
export default function GlobalError({ error, reset }: { error: Error & { digest?: string }; reset: () => void }) {
useEffect(() => {
console.error(error);
}, [error]);
return (
<div style={{ padding: 24 }}>
<h2> .</h2>
<p>{error.message}</p>
<button onClick={() => reset()}> </button>
</div>
);
}