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-compiler/directives/use-no-memo.md
+49-49Lines changed: 49 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,143 +5,143 @@ titleForTitleTag: "'use no memo' directive"
5
5
6
6
<Intro>
7
7
8
-
`"use no memo"` prevents a function from being optimized by React Compiler.
8
+
`"use no memo"`는 React 컴파일러가 특정 함수를 최적화하지 않도록 합니다.
9
9
10
10
</Intro>
11
11
12
12
<InlineToc />
13
13
14
14
---
15
15
16
-
## Reference {/*reference*/}
16
+
## 레퍼런스 {/*reference*/}
17
17
18
18
### `"use no memo"` {/*use-no-memo*/}
19
19
20
-
Add `"use no memo"` at the beginning of a function to prevent React Compiler optimization.
20
+
React 컴파일러 최적화를 방지하려면 함수의 시작 부분에 `"use no memo"`를 추가하세요.
21
21
22
-
```js {1}
22
+
```js {2}
23
23
functionMyComponent() {
24
24
"use no memo";
25
25
// ...
26
26
}
27
27
```
28
28
29
-
When a function contains `"use no memo"`, the React Compiler will skip it entirely during optimization. This is useful as a temporary escape hatch when debugging or when dealing with code that doesn't work correctly with the compiler.
29
+
함수에 `"use no memo"`가 포함되어 있으면 React 컴파일러는 최적화 중에 해당 함수를 완전히 건너뜁니다. 이것은 디버깅할 때나, 컴파일러와 제대로 동작하지 않는 코드를 다룰 때 임시 탈출구로 유용합니다.
30
30
31
-
#### Caveats {/*caveats*/}
31
+
#### 주의 사항 {/*caveats*/}
32
32
33
-
*`"use no memo"` must be at the very beginning of a function body, before any imports or other code (comments are OK).
34
-
*The directive must be written with double or single quotes, not backticks.
35
-
*The directive must exactly match `"use no memo"`or its alias `"use no forget"`.
36
-
*This directive takes precedence over all compilation modes and other directives.
37
-
*It's intended as a temporary debugging tool, not a permanent solution.
33
+
*`"use no memo"`는 import나 다른 코드보다 먼저 함수 본문의 맨 처음에 있어야 합니다. (주석은 괜찮습니다.)
34
+
*지시어는 백틱이 아닌 큰따옴표나 작은따옴표로 작성해야 합니다.
35
+
*지시어는 `"use no memo"`또는 별칭인 `"use no forget"`과 정확히 일치해야 합니다.
36
+
*이 지시어는 모든 컴파일 모드와 다른 지시어보다 우선합니다.
37
+
*이것은 영구적인 해결책이 아닌 임시 디버깅 도구로 사용하기 위한 것입니다.
38
38
39
-
### How `"use no memo"` opts-out of optimization {/*how-use-no-memo-opts-out*/}
39
+
### `"use no memo"`가 최적화를 제외하는 방법 {/*how-use-no-memo-opts-out*/}
40
40
41
-
React Compiler analyzes your code at build time to apply optimizations. `"use no memo"` creates an explicit boundary that tells the compiler to skip a function entirely.
41
+
React 컴파일러는 빌드 시간에 코드를 분석하여 최적화를 적용합니다. `"use no memo"`는 컴파일러에게 함수를 완전히 건너뛰도록 알려주는 명시적인 경계를 만듭니다.
42
42
43
-
This directive takes precedence over all other settings:
44
-
*In `all`mode: The function is skipped despite the global setting
45
-
*In `infer`mode: The function is skipped even if heuristics would optimize it
43
+
이 지시어는 다른 모든 설정보다 우선합니다.
44
+
*`all`모드에서: 전역 설정에도 불구하고 함수를 건너뜁니다.
45
+
*`infer`모드에서: 휴리스틱이 최적화할 경우에도 함수를 건너뜁니다.
46
46
47
-
The compiler treats these functions as if the React Compiler wasn't enabled, leaving them exactly as written.
47
+
컴파일러는 React 컴파일러가 활성화되지 않은 것처럼 이러한 함수를 처리하여 작성된 그대로 유지합니다.
48
48
49
-
### When to use `"use no memo"` {/*when-to-use*/}
49
+
### `"use no memo"`를 사용해야 하는 경우 {/*when-to-use*/}
50
50
51
-
`"use no memo"` should be used sparingly and temporarily. Common scenarios include:
51
+
`"use no memo"`는 드물게 그리고 임시로 사용해야 합니다. 일반적인 시나리오는 다음과 같습니다.
0 commit comments