Error 에러 처리 컴포넌트별 역할 정리
#176
sgoldenbird
started this conversation in
Development Guidelines
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
1. GlobalErrorBoundary
/)의errorElement로 지정.2. ApiErrorBoundary
loader또는action에서 발생하는 API 에러 처리. loader/action 안에서 발생한 HTTP 응답 오류 처리 (401, 403, 404, 500 등)errorElement로 지정.3. RenderErrorBoundary
react-error-boundary를 사용.4. try...catch
useEffect,loader,action내 비동기 작업에 사용.실제 흐름 예시
이 경우 에러 메시지를 직접 loader 안에서
return <div>에러입니다</div>이런 식으로 처리해야 하는데,이건 라우터 흐름에도 어긋나고 비효율적
요약 정리
/)Beta Was this translation helpful? Give feedback.
All reactions