You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/reference/react-dom/client/createRoot.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,12 +88,12 @@ React는 `root`에 `<App />`을 표시하고 그 안에 있는 DOM을 관리합
88
88
89
89
* 동일한 루트에서 `render`를 두 번 이상 호출하면, React는 필요에 따라 DOM을 업데이트하여 사용자가 전달한 최신 JSX를 반영합니다. React는 이전에 렌더링 된 트리와 ["비교"](/learn/preserving-and-resetting-state)해서 재사용할 수 있는 부분과 다시 만들어야 하는 부분을 결정합니다. 동일한 루트에서 `render`를 다시 호출하는 것은 루트 컴포넌트에서 [`set` 함수](/reference/react/useState#setstate)를 호출하는 것과 비슷합니다. React는 불필요한 DOM 업데이트를 피합니다.
90
90
91
-
* Although rendering is synchronous once it starts, `root.render(...)`is not. This means code after `root.render()`may run before any effects (`useLayoutEffect`,`useEffect`) of that specific render are fired. This is usually fine and rarely needs adjustment. In rare cases where effect timing matters, you can wrap `root.render(...)` in [`flushSync`](https://react.dev/reference/react-dom/flushSync) to ensure the initial render runs fully synchronously.
92
-
91
+
* 렌더링이 시작된 이후에는 동기적으로 실행되지만, `root.render(...)`자체는 비동기적입니다. 즉, `root.render()`이후에 작성된 코드가 해당 렌더링의 `useLayoutEffect`나`useEffect`보다 먼저 실행될 수 있습니다. 일반적인 상황에서는 이러한 동작도 문제 없이 잘 작동하며, 대부분 수정이 필요하지 않습니다. 다만, Effect의 실행 순서가 중요한 경우에는 [`flushSync`](/reference/react-dom/flushSync)로 `root.render(...)` 호출을 감싸면 초기 렌더링이 완전히 동기적으로 실행되도록 보장할 수 있습니다.
같은 루트에서 `render`를 두 번 이상 호출할 수도 있습니다. 컴포넌트 트리 구조가 이전 렌더링과 일치하는 한, React는 [기존 State를 유지](/learn/preserving-and-resetting-state)합니다. 다음 예시에서 입력 창에 어떻게 타이핑하든 관계없이, 매 초 반복되는 `render` 호출로 인한 업데이트가 아무런 문제를 일으키지 않음을 주목하세요.
321
321
@@ -491,22 +491,22 @@ root.render(<App />);
491
491
492
492
---
493
493
494
-
### I'm getting an error: "You passed a second argument to root.render" {/*im-getting-an-error-you-passed-a-second-argument-to-root-render*/}
494
+
### 오류 발생: "root.render에 두 번째 인수를 전달했습니다" {/*im-getting-an-error-you-passed-a-second-argument-to-root-render*/}
495
495
496
-
A common mistake is to pass the options for `createRoot` to`root.render(...)`:
496
+
흔히 하는 실수는 `createRoot`의 옵션을`root.render(...)`에 전달하는 것입니다.
497
497
498
498
<ConsoleBlock level="error">
499
499
500
500
Warning: You passed a second argument to root.render(...) but it only accepts one argument.
501
501
502
502
</ConsoleBlock>
503
503
504
-
To fix, pass the root options to `createRoot(...)`, not `root.render(...)`:
504
+
해결 방법: 루트 옵션은 `root.render(...)`가 아니라 `createRoot(...)`에 전달하세요.
0 commit comments