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/learn/react-compiler/installation.md
+59-59Lines changed: 59 additions & 59 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,60 +1,60 @@
1
1
---
2
-
title: Installation
2
+
title: 安装
3
3
---
4
4
5
5
<Intro>
6
-
This guide will help you install and configure React Compiler in your React application.
6
+
本指南将帮助你在 React 应用程序中安装和配置 React Compiler。
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).
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).
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.
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.
-Components will show a "Memo ✨" badge in React DevTools
210
-
-Expensive calculations will be automatically memoized
211
-
-No manual `useMemo` is required
208
+
如果编译器正在工作:
209
+
-组件将在 React DevTools 中显示一个 "Memo ✨" 徽章
210
+
-昂贵的计算将自动被记忆化
211
+
-无需手动使用 `useMemo`
212
212
213
-
### Check Build Output {/*check-build-output*/}
213
+
### 检查构建输出 {/*check-build-output*/}
214
214
215
-
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.
0 commit comments