Skip to content

Commit f8d4c9a

Browse files
committed
wip
1 parent 1caf3ba commit f8d4c9a

File tree

1 file changed

+49
-49
lines changed

1 file changed

+49
-49
lines changed

src/content/reference/react-compiler/directives/use-no-memo.md

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,143 +5,143 @@ titleForTitleTag: "'use no memo' directive"
55

66
<Intro>
77

8-
`"use no memo"` prevents a function from being optimized by React Compiler.
8+
`"use no memo"`는 React 컴파일러가 특정 함수를 최적화하지 않도록 합니다.
99

1010
</Intro>
1111

1212
<InlineToc />
1313

1414
---
1515

16-
## Reference {/*reference*/}
16+
## 레퍼런스 {/*reference*/}
1717

1818
### `"use no memo"` {/*use-no-memo*/}
1919

20-
Add `"use no memo"` at the beginning of a function to prevent React Compiler optimization.
20+
React 컴파일러 최적화를 방지하려면 함수의 시작 부분에 `"use no memo"`를 추가하세요.
2121

22-
```js {1}
22+
```js {2}
2323
function MyComponent() {
2424
"use no memo";
2525
// ...
2626
}
2727
```
2828

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 컴파일러는 최적화 중에 해당 함수를 완전히 건너뜁니다. 이것은 디버깅할 때나, 컴파일러와 제대로 동작하지 않는 코드를 다룰 때 임시 탈출구로 유용합니다.
3030

31-
#### Caveats {/*caveats*/}
31+
#### 주의 사항 {/*caveats*/}
3232

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+
* 이것은 영구적인 해결책이 아닌 임시 디버깅 도구로 사용하기 위한 것입니다.
3838

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*/}
4040

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"`는 컴파일러에게 함수를 완전히 건너뛰도록 알려주는 명시적인 경계를 만듭니다.
4242

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` 모드에서: 휴리스틱이 최적화할 경우에도 함수를 건너뜁니다.
4646

47-
The compiler treats these functions as if the React Compiler wasn't enabled, leaving them exactly as written.
47+
컴파일러는 React 컴파일러가 활성화되지 않은 것처럼 이러한 함수를 처리하여 작성된 그대로 유지합니다.
4848

49-
### When to use `"use no memo"` {/*when-to-use*/}
49+
### `"use no memo"`를 사용해야 하는 경우 {/*when-to-use*/}
5050

51-
`"use no memo"` should be used sparingly and temporarily. Common scenarios include:
51+
`"use no memo"`는 드물게 그리고 임시로 사용해야 합니다. 일반적인 시나리오는 다음과 같습니다.
5252

53-
#### Debugging compiler issues {/*debugging-compiler*/}
54-
When you suspect the compiler is causing issues, temporarily disable optimization to isolate the problem:
53+
#### 컴파일러 문제 디버깅 {/*debugging-compiler*/}
54+
컴파일러가 문제를 일으키는 것으로 의심되면 문제를 분리하기 위해 일시적으로 최적화를 비활성화하세요.
5555

5656
```js
5757
function ProblematicComponent({ data }) {
58-
"use no memo"; // TODO: Remove after fixing issue #123
58+
"use no memo"; // TODO: 이슈 #123 수정 후 제거
5959

60-
// Rules of React violations that weren't statically detected
60+
// 정적으로 감지되지 않은 React 규칙 위반
6161
// ...
6262
}
6363
```
6464

65-
#### Third-party library integration {/*third-party*/}
66-
When integrating with libraries that might not be compatible with the compiler:
65+
#### 서드 파티 라이브러리 통합 {/*third-party*/}
66+
컴파일러와 호환되지 않을 수 있는 라이브러리와 통합할 때 사용합니다.
6767

6868
```js
6969
function ThirdPartyWrapper() {
7070
"use no memo";
7171

72-
useThirdPartyHook(); // Has side effects that compiler might optimize incorrectly
72+
useThirdPartyHook(); // 컴파일러가 잘못 최적화할 수 있는 사이드 이펙트가 있음
7373
// ...
7474
}
7575
```
7676

7777
---
7878

79-
## Usage {/*usage*/}
79+
## 사용법 {/*usage*/}
8080

81-
The `"use no memo"` directive is placed at the beginning of a function body to prevent React Compiler from optimizing that function:
81+
`"use no memo"` 지시어는 React 컴파일러가 해당 함수를 최적화하지 않도록 함수 본문의 시작 부분에 배치합니다.
8282

8383
```js
8484
function MyComponent() {
8585
"use no memo";
86-
// Function body
86+
// 함수 본문
8787
}
8888
```
8989

90-
The directive can also be placed at the top of a file to affect all functions in that module:
90+
지시어는 해당 모듈의 모든 함수에 영향을 미치도록 파일 상단에 배치할 수도 있습니다.
9191

9292
```js
9393
"use no memo";
9494

95-
// All functions in this file will be skipped by the compiler
95+
// 이 파일의 모든 함수는 컴파일러에 의해 건너뛰어집니다
9696
```
9797

98-
`"use no memo"` at the function level overrides the module level directive.
98+
함수 수준의 `"use no memo"`는 모듈 수준의 지시어를 재정의합니다.
9999

100100
---
101101

102-
## Troubleshooting {/*troubleshooting*/}
102+
## 문제 해결 {/*troubleshooting*/}
103103

104-
### Directive not preventing compilation {/*not-preventing*/}
104+
### 지시어가 컴파일을 방지하지 않는 경우 {/*not-preventing*/}
105105

106-
If `"use no memo"` isn't working:
106+
`"use no memo"`가 작동하지 않는 경우입니다.
107107

108108
```js
109-
//Wrong - directive after code
109+
//잘못된 예 - 코드 뒤에 지시어
110110
function Component() {
111111
const data = getData();
112-
"use no memo"; // Too late!
112+
"use no memo"; // 너무 늦음!
113113
}
114114

115-
//Correct - directive first
115+
//올바른 예 - 지시어가 먼저
116116
function Component() {
117117
"use no memo";
118118
const data = getData();
119119
}
120120
```
121121

122-
Also check:
123-
* Spelling - must be exactly `"use no memo"`
124-
* Quotes - must use single or double quotes, not backticks
122+
다음도 확인하세요.
123+
* 철자 - `"use no memo"`와 정확히 일치해야 합니다.
124+
* 따옴표 - 백틱이 아닌 작은따옴표나 큰따옴표를 사용해야 합니다.
125125

126-
### Best practices {/*best-practices*/}
126+
### 모범 사례 {/*best-practices*/}
127127

128-
**Always document why** you're disabling optimization:
128+
최적화를 비활성화하는 **이유를 항상 문서화하세요**.
129129

130130
```js
131-
//Good - clear explanation and tracking
131+
//좋은 예 - 명확한 설명과 추적
132132
function DataProcessor() {
133-
"use no memo"; // TODO: Remove after fixing rule of react violation
133+
"use no memo"; // TODO: React 규칙 위반 수정 후 제거
134134
// ...
135135
}
136136

137-
//Bad - no explanation
137+
//나쁜 예 - 설명 없음
138138
function Mystery() {
139139
"use no memo";
140140
// ...
141141
}
142142
```
143143

144-
### See also {/*see-also*/}
144+
### 참고 {/*see-also*/}
145145

146-
* [`"use memo"`](/reference/react-compiler/directives/use-memo) - Opt into compilation
147-
* [React Compiler](/learn/react-compiler) - Getting started guide
146+
* [`"use memo"`](/reference/react-compiler/directives/use-memo) - 컴파일에 포함하기
147+
* [React 컴파일러](/learn/react-compiler) - 시작 가이드

0 commit comments

Comments
 (0)