Skip to content

Commit 392853f

Browse files
committed
2 parents da73f36 + a1ef21d commit 392853f

9 files changed

Lines changed: 115 additions & 115 deletions

File tree

‎src/content/learn/lifecycle-of-reactive-effects.md‎

Lines changed: 59 additions & 59 deletions
Large diffs are not rendered by default.

‎src/content/learn/removing-effect-dependencies.md‎

Lines changed: 22 additions & 22 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ root.render(<App />);
156156
<html>
157157
<head><title>My app</title></head>
158158
<body>
159-
<!-- 이것은은 DOM 노드입니다. -->
159+
<!-- 이것은 DOM 노드입니다. -->
160160
<div id="root"></div>
161161
</body>
162162
</html>

‎src/content/reference/react/Children.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ export default function TabSwitcher({ tabIds, getHeader, renderContent }) {
847847
848848
`renderContent`와 같이 사용자 인터페이스의 일부를 어떻게 렌더링할지 정의하는 Prop를 *렌더링 Prop*라고 합니다. 하지만 특별한 것은 아닙니다. 단지 일반적인 함수의 Prop일 뿐입니다.
849849
850-
렌더링 Prop은은 함수이므로 정보를 전달할 수 있습니다.
850+
렌더링 Prop은 함수이므로 정보를 전달할 수 있습니다.
851851
아래 예시에서 `RowList` 컴포넌트는 각 row의 `id`와 `index`를 `renderRow`에 렌더링 Prop로 전달하고, `index`가 짝수인 row를 강조합니다.
852852
853853
<Sandpack>

‎src/content/reference/react/Component.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ constructor는 부수 효과 또는 구독을 포함하면 안 됩니다.
222222

223223
#### 주의 사항 {/*componentdidcatch-caveats*/}
224224

225-
* 과거에는 UI를 업데이트하고 대체 에러 메세지를 표시하기 위해 `setState`를 `componentDidCatch` 안에서 호출하는 것이 일반적이었습니다. 이는 [`static getDerivedStateFromError`](#static-getderivedstatefromerror)를 정의하기 위해 더 이상 사용되지 않습니다.
225+
* 과거에는 UI를 업데이트하고 대체 에러 메시지를 표시하기 위해 `setState`를 `componentDidCatch` 안에서 호출하는 것이 일반적이었습니다. 이는 [`static getDerivedStateFromError`](#static-getderivedstatefromerror)를 정의하기 위해 더 이상 사용되지 않습니다.
226226

227227
* React의 프로덕션과 개발 빌드는 `componentDidCatch`가 에러를 처리하는 방식이 약간 다릅니다. 개발에서는, 에러는 `window`까지 버블링될 것이며, 이는 `window.onerror` 또는 `window.addEventListener('error', callback)`가 `componentDidCatch`에 의해 탐지된 에러를 가로챈다는 것을 의미합니다. 대신 프로덕션에서, 에러는 버블링되지 않을 것이며, 이는 어떤 상위의 에러 핸들러가 `componentDidCatch`에 의해 명시적으로 탐지되지 않은 에러만을 수신하는 것을 의미합니다.
228228

‎src/content/reference/react/useEffect.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,7 +1134,7 @@ function ChatRoom() {
11341134
useEffect(() => {
11351135
// ...
11361136
// 🔴 Avoid suppressing the linter like this:
1137-
// eslint-ignore-next-line react-hooks/exhaustive-deps
1137+
// eslint-disable-next-line react-hooks/exhaustive-deps
11381138
}, []);
11391139
```
11401140
@@ -1154,7 +1154,7 @@ useEffect(() => {
11541154
}, [a, b]); // a나 b가 다르면 다시 실행됨
11551155
```
11561156
1157-
아래 예시에서는 `serverUrl`와 `roomId`은 [반응형 값](/learn/lifecycle-of-reactive-effects#effects-react-to-reactive-values)이므로 둘 다 의존성으로 지정해야 합니다. 결과적으로 드롭다운에서 다른 방을 선택하거나 서버 URL 입력을 편집하면 채팅이 다시 연결됩니다. 그러나 `message`는 Effect에서 사용되지 않으므로(의존성이 아니므로), 메세지를 편집해도 대화가 다시 연결되지 않습니다.
1157+
아래 예시에서는 `serverUrl`와 `roomId`은 [반응형 값](/learn/lifecycle-of-reactive-effects#effects-react-to-reactive-values)이므로 둘 다 의존성으로 지정해야 합니다. 결과적으로 드롭다운에서 다른 방을 선택하거나 서버 URL 입력을 편집하면 채팅이 다시 연결됩니다. 그러나 `message`는 Effect에서 사용되지 않으므로(의존성이 아니므로), 메시지를 편집해도 대화가 다시 연결되지 않습니다.
11581158
11591159
<Sandpack>
11601160

‎src/content/reference/react/useReducer.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ function reducer(state, action) {
10641064
10651065
### "Too many re-renders" 오류가 발생합니다. {/*im-getting-an-error-too-many-re-renders*/}
10661066
1067-
`Too many re-renders. React limits the number of renders to prevent an infinite loop.`라는 에러 메세지를 받을 수 있습니다. 일반적으로는 렌더링 과정에서 dispatch가 실행될 때 이러한 일이 일어납니다. 렌더링은 dispatch를 야기하고, dispatch는 렌더링을 야기하므로 렌더링 무한 루프가 일어납니다. 이러한 상황은 이벤트 핸들러를 잘못 호출할 때 종종 발생합니다.
1067+
`Too many re-renders. React limits the number of renders to prevent an infinite loop.`라는 에러 메시지를 받을 수 있습니다. 일반적으로는 렌더링 과정에서 dispatch가 실행될 때 이러한 일이 일어납니다. 렌더링은 dispatch를 야기하고, dispatch는 렌더링을 야기하므로 렌더링 무한 루프가 일어납니다. 이러한 상황은 이벤트 핸들러를 잘못 호출할 때 종종 발생합니다.
10681068
10691069
```js {1-2}
10701070
// 🚩 Wrong: calls the handler during render

‎src/content/reference/react/useRef.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,9 @@ function Video() {
512512
513513
<DeepDive>
514514
515-
#### `useRef`를 초기화할 때 null 검사를 피하는 방법 {/*how-to-avoid-null-checks-when-initializing-use-ref-later*/}
515+
#### `useRef`를 초기화할 때 `null` 검사를 피하는 방법 {/*how-to-avoid-null-checks-when-initializing-use-ref-later*/}
516516
517-
타입 검사기를 사용하면서 항상 `null`을 검사하고 싶지 않다면 다음과 같은 패턴을 대신 사용해 볼 수 있습니다:
517+
타입 검사기를 사용하면서 항상 `null`을 검사하고 싶지 않다면 다음과 같은 패턴을 대신 사용해 볼 수 있습니다.
518518
519519
```js
520520
function Video() {
@@ -542,15 +542,15 @@ function Video() {
542542
543543
### 커스텀 컴포넌트에 대한 ref를 얻을 수 없습니다 {/*i-cant-get-a-ref-to-a-custom-component*/}
544544
545-
컴포넌트에 `ref`를 전달하고자 다음과 같이 하면:
545+
컴포넌트에 `ref`를 전달하고자 다음과 같이 하면
546546
547547
```js
548548
const inputRef = useRef(null);
549549

550550
return <MyInput ref={inputRef} />;
551551
```
552552
553-
다음과 같은 오류가 발생할 것입니다:
553+
다음과 같은 오류가 발생할 것입니다.
554554
555555
<ConsoleBlock level="error">
556556
@@ -560,7 +560,7 @@ TypeError: Cannot read properties of null
560560
561561
기본적으로 컴포넌트는 내부의 DOM 노드에 대한 ref를 외부로 노출하지 않습니다.
562562
563-
이 문제를 해결하려면 ref를 가져오고자 하는 컴포넌트를 찾으세요:
563+
이 문제를 해결하려면 ref를 가져오고자 하는 컴포넌트를 찾으세요.
564564
565565
```js
566566
export default function MyInput({ value, onChange }) {

0 commit comments

Comments
 (0)