Skip to content

Commit d24840e

Browse files
committed
docs: translate 'Error logging in production' section of the hydrateRoot page
1 parent 49bfb13 commit d24840e

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

src/content/reference/react-dom/client/createRoot.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -373,17 +373,17 @@ const root = createRoot(container, {
373373
374374
<CodeStep step={1}>onCaughtError</CodeStep> 옵션은 다음 두 개의 인자를 받는 함수입니다.
375375
376-
1. 발생한 <CodeStep step={2}>error</CodeStep> 객체입니다.
377-
2. <CodeStep step={3}>errorInfo</CodeStep> 객체는 오류의 <CodeStep step={4}>componentStack</CodeStep> 정보를 포함합니다.
376+
1. 발생한 <CodeStep step={2}>error</CodeStep> 객체
377+
2. <CodeStep step={4}>componentStack</CodeStep> 속성이 포함된 <CodeStep step={3}>errorInfo</CodeStep> 객체
378378
379379
`onUncaughtError``onRecoverableError`를 함께 사용하면, 사용자 정의 오류 보고 시스템을 구현할 수 있습니다.
380380
381381
<Sandpack>
382382
383383
```js src/reportError.js
384384
function reportError({ type, error, errorInfo }) {
385-
// The specific implementation is up to you.
386-
// `console.error()` is only used for demonstration purposes.
385+
// 구체적인 구현은 여러분에게 맡깁니다.
386+
// `console.error()`는 설명을 위한 용도입니다.
387387
console.error(type, error, "Component Stack: ");
388388
console.error("Component Stack: ", errorInfo.componentStack);
389389
}
@@ -414,9 +414,9 @@ import {
414414

415415
const container = document.getElementById("root");
416416
const root = createRoot(container, {
417-
// Keep in mind to remove these options in development to leverage
418-
// React's default handlers or implement your own overlay for development.
419-
// The handlers are only specfied unconditionally here for demonstration purposes.
417+
// 개발 환경에서는 이 옵션들을 제거하고
418+
// React의 기본 핸들러를 사용하거나 직접 오버레이를 구현하는 것을 권장합니다.
419+
// 여기서는 편의를 위해 조건 없이 핸들러를 지정했습니다.
420420
onCaughtError: onCaughtErrorProd,
421421
onRecoverableError: onRecoverableErrorProd,
422422
onUncaughtError: onUncaughtErrorProd,

src/content/reference/react-dom/client/hydrateRoot.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ export default function App({counter}) {
370370
371371
Hydration된 루트에서 [`root.render`](#root-render)를 호출하는 것은 흔한 일은 아닙니다. 내부 컴포넌트 중 한 곳에서 [useState](/reference/react/useState)를 사용하는 것이 일반적입니다.
372372
373-
### Error logging in production {/*error-logging-in-production*/}
373+
### 프로덕션 환경에서 오류 로깅하기 {/*error-logging-in-production*/}
374374
375-
By default, React will log all errors to the console. To implement your own error reporting, you can provide the optional error handler root options `onUncaughtError`, `onCaughtError` and `onRecoverableError`:
375+
React는 기본적으로 모든 오류를 콘솔에 출력합니다. 사용자 정의 오류 보고 기능을 구현하기 위해서 `onUncaughtError`, `onCaughtError`, `onRecoverableError`와 같은 에러 핸들러 루트 옵션을 제공할 수 있습니다.
376376
377377
```js [[1, 7, "onCaughtError"], [2, 7, "error", 1], [3, 7, "errorInfo"], [4, 11, "componentStack", 15]]
378378
import { hydrateRoot } from "react-dom/client";
@@ -392,19 +392,19 @@ const root = hydrateRoot(container, <App />, {
392392
});
393393
```
394394
395-
The <CodeStep step={1}>onCaughtError</CodeStep> option is a function called with two arguments:
395+
<CodeStep step={1}>onCaughtError</CodeStep> 옵션은 다음 두 개의 인자를 받는 함수입니다.
396396
397-
1. The <CodeStep step={2}>error</CodeStep> that was thrown.
398-
2. An <CodeStep step={3}>errorInfo</CodeStep> object that contains the <CodeStep step={4}>componentStack</CodeStep> of the error.
397+
1. 발생한 <CodeStep step={2}>error</CodeStep> 객체
398+
2. <CodeStep step={4}>componentStack</CodeStep> 속성이 포함된 <CodeStep step={3}>errorInfo</CodeStep> 객체
399399
400-
Together with `onUncaughtError` and `onRecoverableError`, you can implement your own error reporting system:
400+
`onUncaughtError``onRecoverableError`를 함께 사용하면, 사용자 정의 오류 보고 시스템을 구현할 수 있습니다.
401401
402402
<Sandpack>
403403
404404
```js src/reportError.js
405405
function reportError({ type, error, errorInfo }) {
406-
// The specific implementation is up to you.
407-
// `console.error()` is only used for demonstration purposes.
406+
// 구체적인 구현은 여러분에게 맡깁니다.
407+
// `console.error()`는 설명을 위한 용도입니다.
408408
console.error(type, error, "Component Stack: ");
409409
console.error("Component Stack: ", errorInfo.componentStack);
410410
}
@@ -435,9 +435,9 @@ import {
435435

436436
const container = document.getElementById("root");
437437
hydrateRoot(container, <App />, {
438-
// Keep in mind to remove these options in development to leverage
439-
// React's default handlers or implement your own overlay for development.
440-
// The handlers are only specfied unconditionally here for demonstration purposes.
438+
// 개발 환경에서는 이 옵션들을 제거하고
439+
// React의 기본 핸들러를 사용하거나 직접 오버레이를 구현하는 것을 권장합니다.
440+
// 여기서는 편의를 위해 조건 없이 핸들러를 지정했습니다.
441441
onCaughtError: onCaughtErrorProd,
442442
onRecoverableError: onRecoverableErrorProd,
443443
onUncaughtError: onUncaughtErrorProd,

0 commit comments

Comments
 (0)