https://nextjs-ko.org/docs/app/building-your-application/routing/error-handling
Error Handling – Nextjs 한글 문서
Learn how to display expected errors and handle uncaught exceptions.
nextjs-ko.org
nextJs 프로젝트를 시작 하기 전 해당 글을 읽으며 이해가 안된 부분이 있었다.
'use client' // Error boundaries must be Client Components
export default function GlobalError({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
return (
// global-error must include html and body tags
<html>
<body>
<h2>Something went wrong!</h2>
<button onClick={() => reset()}>Try again</button>
</body>
</html>
)
}
해당 예제인데 해당 페이지엔 props로 받아오는 error와 reset 구문을 어디에도 찾을 수 없었고
reset의 역할이 궁금했는데 처음엔 refetch로 해당 페이지에 api만 재호출 하는 개념으로 이해 중이었다.
하지만 찾아보니

해당 블로그를 찾아보니 refetch 개념이 아닌 단순 re-render 역할이었다.
nextJs에 대핸 더욱 공부가 필요한 것 같다 ^_^
'nextJs' 카테고리의 다른 글
| 바이낸스 api 호출하여 시가총액 50 차트 보여주기 (0) | 2025.10.16 |
|---|---|
| nextJs로 투자 차트 불러오기 (2) | 2025.09.22 |
| 바이낸스 api로 차트 만들기 (0) | 2025.09.22 |