@@ -4,7 +4,7 @@ title: target
44
55<Intro >
66
7- The ` target ` option specifies which React version the compiler should generate code for .
7+ ` target ` 옵션은 컴파일러가 어떤 React 버전을 위한 코드를 생성해야 하는지 지정합니다 .
88
99</Intro >
1010
@@ -18,67 +18,67 @@ The `target` option specifies which React version the compiler should generate c
1818
1919---
2020
21- ## Reference {/* reference* /}
21+ ## 레퍼런스 {/* reference* /}
2222
2323### ` target ` {/* target* /}
2424
25- Configures the React version compatibility for the compiled output .
25+ 컴파일된 출력의 React 버전 호환성을 설정합니다 .
2626
27- #### Type {/* type* /}
27+ #### 타입 {/* type* /}
2828
2929```
3030'17' | '18' | '19'
3131```
3232
33- #### Default value {/* default-value* /}
33+ #### 기본값 {/* default-value* /}
3434
3535` '19' `
3636
37- #### Valid values {/* valid-values* /}
37+ #### 유효한 값 {/* valid-values* /}
3838
39- - ** ` '19' ` ** : Target React 19 (default ). No additional runtime required .
40- - ** ` '18' ` ** : Target React 18. Requires ` react-compiler-runtime ` package .
41- - ** ` '17' ` ** : Target React 17. Requires ` react-compiler-runtime ` package .
39+ - ** ` '19' ` ** : React 19를 대상으로 합니다 (기본값 ). 추가 런타임이 필요하지 않습니다 .
40+ - ** ` '18' ` ** : React 18을 대상으로 합니다. ` react-compiler-runtime ` 패키지가 필요합니다 .
41+ - ** ` '17' ` ** : React 17을 대상으로 합니다. ` react-compiler-runtime ` 패키지가 필요합니다 .
4242
43- #### Caveats {/* caveats* /}
43+ #### 주의 사항 {/* caveats* /}
4444
45- - Always use string values, not numbers (e.g., ` '17' ` not ` 17 ` )
46- - Don't include patch versions (e.g., use ` '18' ` not ` '18.2.0' ` )
47- - React 19 includes built-in compiler runtime APIs
48- - React 17 and 18 require installing ` react-compiler-runtime@latest `
45+ - 숫자가 아닌 문자열 값을 사용하세요. (예: ` 17 ` 이 아닌 ` '17' ` )
46+ - 패치 버전은 포함하지 마세요. (예: ` '18.2.0' ` 이 아닌 ` '18' ` 을 사용 )
47+ - React 19는 컴파일러 런타임 API가 내장되어 있습니다.
48+ - React 17과 18은 ` react-compiler-runtime@latest ` 설치가 필요합니다.
4949
5050---
5151
52- ## Usage {/* usage* /}
52+ ## 사용법 {/* usage* /}
5353
54- ### Targeting React 19 (default ) {/* targeting-react-19* /}
54+ ### React 19 대상으로 하기 (기본값 ) {/* targeting-react-19* /}
5555
56- For React 19, no special configuration is needed:
56+ React 19의 경우 특별한 설정이 필요하지 않습니다.
5757
5858``` js
5959{
6060 // defaults to target: '19'
6161}
6262```
6363
64- The compiler will use React 19's built-in runtime APIs:
64+ 컴파일러는 React 19의 내장 런타임 API를 사용합니다.
6565
6666``` js
67- // Compiled output uses React 19's native APIs
67+ // 컴파일된 출력은 React 19의 네이티브 API를 사용합니다.
6868import { c as _c } from ' react/compiler-runtime' ;
6969```
7070
71- ### Targeting React 17 or 18 {/* targeting-react-17-or-18* /}
71+ ### React 17 또는 18 대상으로 하기 {/* targeting-react-17-or-18* /}
7272
73- For React 17 and React 18 projects, you need two steps:
73+ React 17과 React 18 프로젝트의 경우 두 단계가 필요합니다.
7474
75- 1 . Install the runtime package:
75+ 1 . 런타임 패키지를 설치합니다.
7676
7777``` bash
7878npm install react-compiler-runtime@latest
7979```
8080
81- 2 . Configure the target:
81+ 2 . ` target ` 을 설정합니다.
8282
8383``` js
8484// For React 18
@@ -92,57 +92,57 @@ npm install react-compiler-runtime@latest
9292}
9393```
9494
95- The compiler will use the polyfill runtime for both versions:
95+ 컴파일러는 두 버전 모두에 대해 폴리필 런타임을 사용합니다.
9696
9797``` js
98- // Compiled output uses the polyfill
98+ // 컴파일된 출력은 폴리필을 사용합니다.
9999import { c as _c } from ' react-compiler-runtime' ;
100100```
101101
102102---
103103
104- ## Troubleshooting {/* troubleshooting* /}
104+ ## 문제 해결 {/* troubleshooting* /}
105105
106- ### Runtime errors about missing compiler runtime {/* missing-runtime* /}
106+ ### 컴파일러 런타임 누락에 관한 런타임 오류 {/* missing-runtime* /}
107107
108- If you see errors like "Cannot find module 'react/compiler-runtime'":
108+ "Cannot find module 'react/compiler-runtime'"와 같은 오류가 표시되는 경우에는 다음과 같이 합니다.
109109
110- 1 . Check your React version:
110+ 1 . React 버전을 확인합니다.
111111 ``` bash
112112 npm why react
113113 ```
114114
115- 2 . If using React 17 or 18, install the runtime:
115+ 2 . React 17 또는 18을 사용하는 경우 런타임을 설치합니다.
116116 ``` bash
117117 npm install react-compiler-runtime@latest
118118 ```
119119
120- 3 . Ensure your target matches your React version:
120+ 3 . target이 React 버전과 일치하는지 확인합니다.
121121 ``` js
122122 {
123- target: ' 18' // Must match your React major version
123+ target: ' 18' // React 메이저 버전과 일치해야 합니다
124124 }
125125 ```
126126
127- ### Runtime package not working {/* runtime-not-working* /}
127+ ### 런타임 패키지가 작동하지 않는 경우 {/* runtime-not-working* /}
128128
129- Ensure the runtime package is:
129+ 런타임 패키지가 다음 조건을 만족하는지 확인하세요.
130130
131- 1 . Installed in your project (not globally )
132- 2 . Listed in your ` package.json ` dependencies
133- 3 . The correct version (` @latest ` tag )
134- 4 . Not in ` devDependencies ` (it's needed at runtime )
131+ 1 . 프로젝트에 설치되어 있어야 합니다. (전역이 아닌 )
132+ 2 . ` package.json ` 의 ` dependencies ` 에 나열되어 있어야 합니다.
133+ 3 . 올바른 버전이어야 합니다. (` @latest ` 태그 )
134+ 4 . ` devDependencies ` 에 있으면 안 됩니다. (런타임에 필요합니다 )
135135
136- ### Checking compiled output {/* checking-output* /}
136+ ### 컴파일된 출력 확인하기 {/* checking-output* /}
137137
138- To verify the correct runtime is being used, note the different import ( ` react/compiler-runtime ` for builtin, ` react-compiler-runtime ` standalone package for 17/18):
138+ 올바른 런타임이 사용되고 있는지 확인하려면 서로 다른 import를 주목하세요. (내장의 경우 ` react/compiler-runtime ` , 17/18용 독립 패키지의 경우 ` react-compiler-runtime ` )
139139
140140``` js
141- // For React 19 (built-in runtime )
141+ // React 19용 (내장 런타임 )
142142import { c } from ' react/compiler-runtime'
143143// ^
144144
145- // For React 17/18 (polyfill runtime )
145+ // React 17/18용 (폴리필 런타임 )
146146import { c } from ' react-compiler-runtime'
147147// ^
148148```
0 commit comments