๐ย Reference
๐ย Chapter
โฃ
componentDidCatch(error, info) {
console.error("์๋ฌ ๋ฐ์:", error);
console.log("์๋ฌ ์์น:", info.componentStack);
sendErrorToSentry(error, info);
}
error, info.componentStack)๋ฅผ ๋ฐ์ ์ ์์| ๋ฉ์๋ | ์์ | ์ญํ | ์ฃผ์์ฌํญ |
|---|---|---|---|
componentDidCatch |
์ปค๋ฐ ๋จ๊ณ | ์๋ฌ ๋ก๊ทธ ์์ง, ๋ณต๊ตฌ ์ฒ๋ฆฌ | side-effect ๊ฐ๋ฅ |
getDerivedStateFromError |
๋ ๋๋ง ๋จ๊ณ | ์๋ฌ ๊ฐ์ง โ state ๋ณ๊ฒฝ์ผ๋ก fallback UI ๋ ๋ | ๋น๋๊ธฐ/side-effect ๊ธ์ง |