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
This guide will help you install and configure React Compiler in your React application.
6
+
이 가이드에서는 React 애플리케이션에 React 컴파일러를 설치하고 설정하는 방법을 알아봅니다.
7
7
</Intro>
8
8
9
9
<YouWillLearn>
10
10
11
-
*How to install React Compiler
12
-
*Basic configuration for different build tools
13
-
*How to verify your setup is working
11
+
*React 컴파일러 설치 방법
12
+
*다양한 빌드 도구를 위한 기본 설정
13
+
*설정이 올바르게 작동하는지 확인하는 방법
14
14
15
15
</YouWillLearn>
16
16
17
-
## Prerequisites {/*prerequisites*/}
17
+
## 필수 조건 {/*prerequisites*/}
18
18
19
-
React Compiler is designed to work best with React 19, but it also supports React 17 and 18. Learn more about [React version compatibility](/reference/react-compiler/target).
19
+
React 컴파일러는 React 19에서 가장 잘 작동하도록 설계되었지만, React 17과 18도 지원합니다. [React 버전 호환성](/reference/react-compiler/target)에서 자세히 알아보세요.
React Compiler is designed to work by default without any configuration. However, if you need to configure it in special circumstances (for example, to target React versions below 19), refer to the [compiler options reference](/reference/react-compiler/configuration).
43
+
React 컴파일러는 기본적으로 별도의 설정 없이 작동하도록 설계되었습니다. 하지만 특수한 상황에서 설정이 필요한 경우(예를 들어 React 19 미만 버전을 타깃으로 하는 경우) [컴파일러 옵션 레퍼런스](/reference/react-compiler/configuration)를 참고하세요.
44
44
45
-
The setup process depends on your build tool. React Compiler includes a Babel plugin that integrates with your build pipeline.
45
+
설정 과정은 빌드 도구에 따라 다릅니다. React 컴파일러는 빌드 파이프라인과 통합되는 Babel 플러그인을 포함하고 있습니다.
46
46
47
47
<Pitfall>
48
-
React Compiler must run **first**in your Babel plugin pipeline. The compiler needs the original source information for proper analysis, so it must process your code before other transformations.
48
+
React 컴파일러는 Babel 플러그인 파이프라인에서 **가장 먼저**실행되어야 합니다. 컴파일러는 적절한 분석을 위해 원본 소스 정보가 필요하므로, 다른 변환보다 먼저 코드를 처리해야 합니다.
49
49
</Pitfall>
50
50
51
51
### Babel {/*babel*/}
52
52
53
-
Create or update your `babel.config.js`:
53
+
`babel.config.js`를 생성하거나 업데이트합니다.
54
54
55
55
```js {3}
56
56
module.exports= {
57
57
plugins: [
58
-
'babel-plugin-react-compiler', //must run first!
59
-
// ... other plugins
58
+
'babel-plugin-react-compiler', //가장 먼저 실행되어야 합니다!
59
+
// ... 다른 플러그인
60
60
],
61
-
// ... other config
61
+
// ... 다른 설정
62
62
};
63
63
```
64
64
65
65
### Vite {/*vite*/}
66
66
67
-
If you use Vite, you can add the plugin to vite-plugin-react:
67
+
Vite를 사용하는 경우 `vite-plugin-react`에 플러그인을 추가할 수 있습니다.
68
68
69
69
```js {3,9}
70
70
// vite.config.js
@@ -82,7 +82,7 @@ export default defineConfig({
82
82
});
83
83
```
84
84
85
-
Alternatively, if you prefer a separate Babel plugin for Vite:
A community webpack loader is [now available here](https://github.com/SukkaW/react-compiler-webpack).
146
+
커뮤니티에서 제공하는 webpack loader는 [여기에서 확인할 수 있습니다](https://github.com/SukkaW/react-compiler-webpack).
147
147
148
148
### Expo {/*usage-with-expo*/}
149
149
150
-
Please refer to [Expo's docs](https://docs.expo.dev/guides/react-compiler/) to enable and use the React Compiler in Expo apps.
150
+
Expo 앱에서 React 컴파일러를 활성화하고 사용하는 방법은 [Expo 문서](https://docs.expo.dev/guides/react-compiler/)를 참고하세요.
151
151
152
152
### Metro (React Native) {/*usage-with-react-native-metro*/}
153
153
154
-
React Native uses Babel via Metro, so refer to the [Usage with Babel](#babel)section for installation instructions.
154
+
React Native는 Metro를 통해 Babel을 사용하므로, 설치 방법은 [Babel 사용법](#babel)섹션을 참고하세요.
155
155
156
156
### Rspack {/*usage-with-rspack*/}
157
157
158
-
Please refer to [Rspack's docs](https://rspack.dev/guide/tech/react#react-compiler) to enable and use the React Compiler in Rspack apps.
158
+
Rspack 앱에서 React 컴파일러를 활성화하고 사용하는 방법은 [Rspack 문서](https://rspack.dev/guide/tech/react#react-compiler)를 참고하세요.
159
159
160
160
### Rsbuild {/*usage-with-rsbuild*/}
161
161
162
-
Please refer to [Rsbuild's docs](https://rsbuild.dev/guide/framework/react#react-compiler) to enable and use the React Compiler in Rsbuild apps.
162
+
Rsbuild 앱에서 React 컴파일러를 활성화하고 사용하는 방법은 [Rsbuild 문서](https://rsbuild.dev/guide/framework/react#react-compiler)를 참고하세요.
163
163
164
164
165
-
## ESLint Integration {/*eslint-integration*/}
165
+
## ESLint 연동 {/*eslint-integration*/}
166
166
167
-
React Compiler includes an ESLint rule that helps identify code that can't be optimized. When the ESLint rule reports an error, it means the compiler will skip optimizing that specific component or hook. This is safe: the compiler will continue optimizing other parts of your codebase. You don't need to fix all violations immediately. Address them at your own pace to gradually increase the number of optimized components.
167
+
React 컴파일러는 최적화할 수 없는 코드를 식별하는 데 도움이 되는 ESLint 규칙을 포함합니다. ESLint 규칙이 오류를 보고하면 컴파일러가 해당 특정 컴포넌트나 Hook의 최적화를 건너뜁니다. 이는 안전합니다. 컴파일러는 코드베이스의 다른 부분을 계속 최적화합니다. 모든 위반 사항을 즉시 수정할 필요는 없습니다. 원하는 속도로 해결하면서 최적화되는 컴포넌트의 수를 점진적으로 늘려가세요.
168
168
169
-
Install the ESLint plugin:
169
+
ESLint 플러그인을 설치합니다.
170
170
171
171
<TerminalBlock>
172
172
npm install -D eslint-plugin-react-hooks@latest
173
173
</TerminalBlock>
174
174
175
-
If you haven't already configured eslint-plugin-react-hooks, follow the [installation instructions in the readme](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#installation). The compiler rules are available in the `recommended-latest`preset.
175
+
`eslint-plugin-react-hooks`를 아직 설정하지 않았다면 [readme의 설치 지침](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#installation)을 따르세요. 컴파일러 규칙은 `recommended-latest`프리셋에서 사용할 수 있습니다.
176
176
177
-
The ESLint rule will:
178
-
-Identify violations of the [Rules of React](/reference/rules)
179
-
-Show which components can't be optimized
180
-
-Provide helpful error messages for fixing issues
177
+
ESLint 규칙은 다음과 같은 역할을 합니다.
178
+
-[React 규칙](/reference/rules) 위반 식별
179
+
-최적화할 수 없는 컴포넌트 표시
180
+
-문제 해결에 도움이 되는 오류 메시지 제공
181
181
182
-
## Verify Your Setup {/*verify-your-setup*/}
182
+
## 설정 확인 {/*verify-your-setup*/}
183
183
184
-
After installation, verify that React Compiler is working correctly.
1.Install the [React Developer Tools](/learn/react-developer-tools)browser extension
191
-
2.Open your app in development mode
192
-
3.Open React DevTools
193
-
4.Look for the ✨ emoji next to component names
190
+
1.[React Developer Tools](/learn/react-developer-tools)브라우저 확장 프로그램을 설치합니다
191
+
2.개발 모드에서 앱을 엽니다
192
+
3. React DevTools를 엽니다
193
+
4.컴포넌트 이름 옆에 ✨ 이모지가 있는지 확인합니다
194
194
195
-
If the compiler is working:
196
-
-Components will show a "Memo ✨" badge in React DevTools
197
-
-Expensive calculations will be automatically memoized
198
-
-No manual `useMemo` is required
195
+
컴파일러가 작동하는 경우
196
+
-컴포넌트에 "Memo ✨" 배지가 React DevTools에 표시됩니다
197
+
-비용이 큰 계산이 자동으로 메모이제이션됩니다
198
+
-수동으로 `useMemo`를 사용할 필요가 없습니다
199
199
200
-
### Check Build Output {/*check-build-output*/}
200
+
### 빌드 출력 확인 {/*check-build-output*/}
201
201
202
-
You can also verify the compiler is running by checking your build output. The compiled code will include automatic memoization logic that the compiler adds automatically.
202
+
빌드 출력을 확인하여 컴파일러가 실행되고 있는지 확인할 수도 있습니다. 컴파일된 코드에는 컴파일러가 자동으로 추가하는 자동 메모이제이션 로직이 포함됩니다.
203
203
204
204
```js
205
205
import { cas_c } from"react/compiler-runtime";
@@ -217,29 +217,29 @@ export default function MyApp() {
217
217
218
218
```
219
219
220
-
## Troubleshooting {/*troubleshooting*/}
220
+
## 문제 해결 {/*troubleshooting*/}
221
221
222
-
### Opting out specific components {/*opting-out-specific-components*/}
222
+
### 특정 컴포넌트 제외하기 {/*opting-out-specific-components*/}
223
223
224
-
If a component is causing issues after compilation, you can temporarily opt it out using the `"use no memo"`directive:
224
+
컴파일 후 특정 컴포넌트에서 문제가 발생하면 `"use no memo"`지시어를 사용하여 일시적으로 해당 컴포넌트를 제외할 수 있습니다.
225
225
226
226
```js
227
227
functionProblematicComponent() {
228
228
"use no memo";
229
-
//Component code here
229
+
//컴포넌트 코드
230
230
}
231
231
```
232
232
233
-
This tells the compiler to skip optimization for this specific component. You should fix the underlying issue and remove the directive once resolved.
233
+
이렇게 하면 컴파일러에게 이 특정 컴포넌트의 최적화를 건너뛰도록 지시합니다. 근본적인 문제를 해결한 후 지시어를 제거해야 합니다.
234
234
235
-
For more troubleshooting help, see the [debugging guide](/learn/react-compiler/debugging).
235
+
더 많은 문제 해결 도움말은 [디버깅 가이드](/learn/react-compiler/debugging)를 참고하세요.
236
236
237
-
## Next Steps {/*next-steps*/}
237
+
## 다음 단계 {/*next-steps*/}
238
238
239
-
Now that you have React Compiler installed, learn more about:
239
+
React 컴파일러를 설치했으니, 다음 내용을 자세히 알아보세요.
240
240
241
-
-[React version compatibility](/reference/react-compiler/target) for React 17 and 18
242
-
-[Configuration options](/reference/react-compiler/configuration) to customize the compiler
243
-
-[Incremental adoption strategies](/learn/react-compiler/incremental-adoption) for existing codebases
244
-
-[Debugging techniques](/learn/react-compiler/debugging) for troubleshooting issues
245
-
-[Compiling Libraries guide](/reference/react-compiler/compiling-libraries) for compiling your React library
241
+
-React 17과 18을 위한 [React 버전 호환성](/reference/react-compiler/target)
242
+
-컴파일러를 사용자 정의하기 위한 [설정 옵션](/reference/react-compiler/configuration)
243
+
-기존 코드베이스를 위한 [점진적 도입 전략](/learn/react-compiler/incremental-adoption)
244
+
-문제 해결을 위한 [디버깅 기법](/learn/react-compiler/debugging)
245
+
-React 라이브러리 컴파일을 위한 [라이브러리 컴파일 가이드](/reference/react-compiler/compiling-libraries)
0 commit comments