React 编译器

简介

🌐 Introduction

了解 React 编译器的功能 以及它如何通过为你处理记忆化自动优化你的 React 应用,从而无需手动进行 useMemouseCallbackReact.memo

🌐 Learn what React Compiler does and how it automatically optimizes your React application by handling memoization for you, eliminating the need for manual useMemo, useCallback, and React.memo.

安装

🌐 Installation

开始 安装 React 编译器 并学习如何用你的构建工具配置它。

🌐 Get started with installing React Compiler and learn how to configure it with your build tools.

增量采用

🌐 Incremental Adoption

如果你还不准备在所有地方启用它,可以学习在现有代码库中逐步采用 React 编译器的策略(strategies for gradually adopting React Compiler)。

🌐 Learn strategies for gradually adopting React Compiler in your existing codebase if you’re not ready to enable it everywhere yet.

调试和故障排除

🌐 Debugging and Troubleshooting

当事情没有按预期工作时,请使用我们的 调试指南 来理解编译器错误和运行时问题之间的区别,识别常见的破坏模式,并遵循系统化的调试工作流程。

🌐 When things don’t work as expected, use our debugging guide to understand the difference between compiler errors and runtime issues, identify common breaking patterns, and follow a systematic debugging workflow.

配置和引用

🌐 Configuration and Reference

有关详细的配置选项和 API 参考:

🌐 For detailed configuration options and API reference:

  • 配置选项 - 包含所有编译器配置选项,包括 React 版本兼容性
  • 指令 - 函数级别的编译控制
  • 编译库 - 提供预编译库

其他资源

🌐 Additional resources

除了这些文档外,我们还建议查看 React 编译器工作组 获取有关编译器的更多信息和讨论。

🌐 In addition to these docs, we recommend checking the React Compiler Working Group for additional information and discussion about the compiler.