Skip to content

Commit bdeb2c3

Browse files
authored
fix conflict
1 parent b738844 commit bdeb2c3

35 files changed

+31
-508
lines changed

src/components/Layout/HomeContent.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -245,20 +245,12 @@ export function HomeContent() {
245245
进行全栈开发
246246
</Header>
247247
<Para>
248-
<<<<<<< HEAD
249248
React
250249
是一个库。它允许你将组件放在一起,但不关注路由和数据获取。要使用
251250
React 构建整个应用程序,我们建议使用像{' '}
252251
<Link href="https://nextjs.org">Next.js</Link>{' '}
253-
<Link href="https://remix.run">Remix</Link> 这样的全栈 React
252+
<Link href="https://reactrouter.com">React Router</Link> 这样的全栈 React
254253
框架。
255-
=======
256-
React is a library. It lets you put components together, but it
257-
doesn’t prescribe how to do routing and data fetching. To build an
258-
entire app with React, we recommend a full-stack React framework
259-
like <Link href="https://nextjs.org">Next.js</Link> or{' '}
260-
<Link href="https://reactrouter.com">React Router</Link>.
261-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
262254
</Para>
263255
</Center>
264256
<FullBleed>

src/content/blog/2024/02/15/react-labs-what-we-have-been-working-on-february-2024.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@ description: 在 React Labs 的文章中,我们讲述了正在进行研究与
1515

1616
</Intro>
1717

18-
<<<<<<< HEAD
19-
<Note>
20-
21-
React Conf 2024 定于 5 月 15 日至 16 日在内华达州亨德森举行!如果有兴趣亲临 React Conf,请在 2 月 28 日之前 [注册门票抽签](https://forms.reform.app/bLaLeE/react-conf-2024-ticket-lottery/1aRQLK)
22-
23-
有关门票、免费直播、赞助等更多信息,请访问 [React Conf 网站](https://conf.react.dev)
24-
25-
</Note>
26-
27-
=======
28-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
2918
---
3019

3120
## React 编译器 {/*react-compiler*/}

src/content/blog/2024/10/21/react-compiler-beta-release.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,9 @@ October 21, 2024 by [Lauren Tan](https://twitter.com/potetotes).
1212

1313
<Note>
1414

15-
<<<<<<< HEAD
16-
### React 编译器现在处于 RC 版本!{/*react-compiler-is-now-in-rc*/}
15+
### React 编译器现在处于稳定版本!{/*react-compiler-is-now-in-rc*/}
1716

18-
有关详细信息,请参阅 [RC 博客文章](/blog/2025/04/21/react-compiler-rc)
19-
=======
20-
### React Compiler is now stable! {/*react-compiler-is-now-in-rc*/}
21-
22-
Please see the [stable release blog post](/blog/2025/10/07/react-compiler-1) for details.
23-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
17+
有关详细信息,请参阅 [稳定版博客文章](/blog/2025/10/07/react-compiler-1)
2418

2519
</Note>
2620

src/content/blog/2025/04/23/react-labs-view-transitions-activity-and-more.md

Lines changed: 4 additions & 125 deletions
Large diffs are not rendered by default.

src/content/blog/index.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@ Last week we hosted React Conf 2025. In this post, we summarize the talks and an
1919

2020
<BlogCard title="React Compiler v1.0" date="October 7, 2025" url="/blog/2025/10/07/react-compiler-1">
2121

22-
<<<<<<< HEAD
23-
我们今天将发布 React Compiler 的第一个候选发布版(RC)。
24-
=======
25-
We're releasing the compiler's first stable release today, plus linting and tooling improvements to make adoption easier.
22+
我们今天将发布 React Compiler 的第一个稳定发布版,以及 linting 和工具改进,使采用更加容易。
2623

2724
</BlogCard>
2825

@@ -41,7 +38,6 @@ React 19.2 adds new features like Activity, React Performance Tracks, useEffectE
4138
<BlogCard title="React Labs: View Transitions, Activity, and more" date="April 23, 2025" url="/blog/2025/04/23/react-labs-view-transitions-activity-and-more">
4239

4340
In React Labs posts, we write about projects in active research and development. In this post, we're sharing two new experimental features that are ready to try today, and sharing other areas we're working on now ...
44-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
4541

4642
</BlogCard>
4743

src/content/errors/index.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
</Intro>
66

7-
我们强烈建议你在本地调试应用时使用开发环境构建,因为它会追踪额外的调试信息,并针对应用中的潜在问题提供有用的警告。但是,如果你在使用生产环境构建时遇到异常,错误信息将只包含一个指向相关错误文档的链接。
87

9-
<<<<<<< HEAD
10-
参阅 [https://react.dev/errors/149](/errors/421) 查看示例。
11-
=======
12-
We highly recommend using the development build locally when debugging your app since it tracks additional debug info and provides helpful warnings about potential problems in your apps, but if you encounter an exception while using the production build, the error message will include just a link to the docs for the error.
8+
我们强烈建议你在本地调试应用时使用开发环境构建,因为它会追踪额外的调试信息,并针对应用中的潜在问题提供有用的警告。但是,如果你在使用生产环境构建时遇到异常,错误信息将只包含一个指向相关错误文档的链接。
139

14-
For an example, see: [https://react.dev/errors/149](/errors/149).
15-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
10+
参阅 [https://react.dev/errors/149](/errors/149) 查看示例。

src/content/learn/escape-hatches.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -312,17 +312,7 @@ React 提供了检查工具规则来检查是否正确地指定了 Effect 的依
312312

313313
## 将事件从 Effect 中分开 {/*separating-events-from-effects*/}
314314

315-
<<<<<<< HEAD
316-
<Wip>
317-
318-
本节描述了一个在稳定版本的 React 中 **尚未发布** 的实验性 API。
319-
320-
</Wip>
321-
322315
事件处理程序仅在再次执行相同的交互时重新运行。与事件处理程序不同,如果 Effect 读取的任何值(如 props 或 state)与上次渲染期间不同,则会重新同步。有时,需要混合两种行为:Effect 重新运行以响应某些值而不是其他值。
323-
=======
324-
Event handlers only re-run when you perform the same interaction again. Unlike event handlers, Effects re-synchronize if any of the values they read, like props or state, are different than during last render. Sometimes, you want a mix of both behaviors: an Effect that re-runs in response to some values but not others.
325-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
326316

327317
Effect 中的所有代码都是 **响应式的**。如果它读取的某些响应式的值由于重新渲染而发生变化,它将再次运行。例如,如果 `roomId``theme` 发生变化,这个 Effect 将重新连接到聊天:
328318

src/content/learn/react-compiler/installation.md

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,7 @@ title: 安装
1818

1919
React 编译器专为与 React 19 配合使用而设计,但也支持 React 17 和 18。了解有关 [React 版本兼容性](/reference/react-compiler/target) 的更多信息。
2020

21-
<<<<<<< HEAD
22-
<Note>
23-
React 编译器当前处于 RC 阶段。请使用 `@rc` 标签安装,以获取最新的发布候选版本。
24-
</Note>
25-
2621
## 安装 {/*installation*/}
27-
=======
28-
## Installation {/*installation*/}
29-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
3022

3123
将 React 编译器安装为 `devDependency`
3224

@@ -180,11 +172,7 @@ React 编译器包含一条 ESLint 规则,可帮助识别无法优化的代码
180172
npm install -D eslint-plugin-react-hooks@latest
181173
</TerminalBlock>
182174

183-
<<<<<<< HEAD
184-
如果你尚未配置好 eslint-plugin-react-hooks,参考 [readme 的安装说明来进行配置](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#installation)。最新的 RC 版本中默认启用了编译器规则,因此不需要其他配置。
185-
=======
186-
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.
187-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
175+
如果你尚未配置好 eslint-plugin-react-hooks,参考 [readme 的安装说明来进行配置](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md#installation)。编译器规则可在 `recommended-latest` 预设中找到。
188176

189177
ESLint 规则将会:
190178
- 识别对 [React 规则](/reference/rules) 的违反情况
@@ -250,16 +238,8 @@ function ProblematicComponent() {
250238

251239
既然你已经安装了 React 编译器,可以进一步了解以下内容:
252240

253-
<<<<<<< HEAD
254241
- [React 版本兼容性](/reference/react-compiler/target),适用于 React 17 和 18
255242
- [配置选项](/reference/react-compiler/configuration),用于自定义编译器
256243
- [渐进采用策略](/learn/react-compiler/incremental-adoption),用于现有的代码库
257244
- [调试技巧](/learn/react-compiler/debugging),用于排查问题
258245
- [编译库指南](/reference/react-compiler/compiling-libraries),用于编译你的 React 库
259-
=======
260-
- [React version compatibility](/reference/react-compiler/target) for React 17 and 18
261-
- [Configuration options](/reference/react-compiler/configuration) to customize the compiler
262-
- [Incremental adoption strategies](/learn/react-compiler/incremental-adoption) for existing codebases
263-
- [Debugging techniques](/learn/react-compiler/debugging) for troubleshooting issues
264-
- [Compiling Libraries guide](/reference/react-compiler/compiling-libraries) for compiling your React library
265-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2

src/content/learn/react-compiler/introduction.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,7 @@ React 编译器是一个新的构建时工具,它可以自动优化你的 Reac
1616

1717
</YouWillLearn>
1818

19-
<<<<<<< HEAD
20-
<Note>
21-
React 编译器目前处于发布候选(RC)阶段。我们现在建议所有人尝试使用该编译器并提供反馈。最新的 RC 版本可以通过 `@rc` 标签找到。
22-
</Note>
23-
24-
## React 编译器是做什么的? {/*what-does-react-compiler-do*/}
25-
=======
2619
## What does React Compiler do? {/*what-does-react-compiler-do*/}
27-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
2820

2921
React 编译器会在构建时自动优化你的 React 应用。通常情况下,即使不进行优化,React 的性能也已经足够快,但有时你需要手动对组件和值进行记忆化(memoization)以保持应用的响应速度。这种手动记忆化既繁琐又容易出错,并且会增加需要维护的额外代码。React 编译器为你自动完成这些优化,减轻了你的思维负担,使你可以专注于功能的开发。
3022

@@ -160,11 +152,7 @@ function TableContainer({ items }) {
160152

161153
### 使用起来安全吗? {/*is-it-safe-to-use*/}
162154

163-
<<<<<<< HEAD
164-
React 编译器目前已进入 RC 阶段,并已在生产环境中进行了广泛测试。虽然像 Meta 这样的公司已经在生产中使用了它,但是否将编译器部署到你的应用程序生产环境,将取决于你的代码库状况以及你对 [React 规则](/reference/rules) 的遵循程度。
165-
=======
166-
React Compiler is now stable and has been tested extensively in production. While it has been used in production at companies like Meta, rolling out the compiler to production for your app will depend on the health of your codebase and how well you've followed the [Rules of React](/reference/rules).
167-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
155+
React 编译器目前已经稳定,并且在生产环境中进行了广泛测试。虽然像 Meta 这样的公司已经在生产中使用了它,但是否将编译器部署到你的应用程序生产环境,将取决于你的代码库状况以及你对 [React 规则](/reference/rules) 的遵循程度。
168156

169157
## 支持哪些构建工具? {/*what-build-tools-are-supported*/}
170158

@@ -176,19 +164,13 @@ Next.js 用户可以通过使用 [v15.3.1](https://github.com/vercel/next.js/rel
176164

177165
## 关于 useMemo、useCallback 和 React.memo 我应该怎么做? {/*what-should-i-do-about-usememo-usecallback-and-reactmemo*/}
178166

179-
<<<<<<< HEAD
180-
React 编译器能够比手动使用 [`useMemo`](/reference/react/useMemo)[`useCallback`](/reference/react/useCallback)[`React.memo`](/reference/react/memo) 更精确和细致地添加自动记忆化。如果你选择保留手动记忆化,React 编译器会分析它们,并判断你的手动记忆化是否与其自动推断出的记忆化一致。如果不一致,编译器将选择放弃优化该组件。
181-
182-
这样做是出于谨慎考虑,因为手动记忆化常见的反模式是为了保证程序的正确性。这意味着你的应用依赖于对特定值进行记忆化才能正常运行。例如,为了防止无限循环,你可能会记忆某些值来阻止 `useEffect` 被触发。这违反了 React 的规则,但因为编译器自动移除手动记忆化可能会有潜在危险,所以会直接放弃优化。你应该手动移除自己的手动记忆化代码,并验证应用是否仍能按预期运行。
183-
=======
184167
By default, React Compiler will memoize your code based on its analysis and heuristics. In most cases, this memoization will be as precise, or moreso, than what you may have written.
185168

186169
However, in some cases developers may need more control over memoization. The `useMemo` and `useCallback` hooks can continue to be used with React Compiler as an escape hatch to provide control over which values are memoized. A common use-case for this is if a memoized value is used as an effect dependency, in order to ensure that an effect does not fire repeatedly even when its dependencies do not meaningfully change.
187170

188171
For new code, we recommend relying on the compiler for memoization and using `useMemo`/`useCallback` where needed to achieve precise control.
189172

190173
For existing code, we recommend either leaving existing memoization in place (removing it can change compilation output) or carefully testing before removing the memoization.
191-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
192174

193175
## 尝试 React 编译器 {/*try-react-compiler*/}
194176

src/content/learn/removing-effect-dependencies.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -610,19 +610,7 @@ function ChatRoom({ roomId }) {
610610
611611
### 你想读取一个值而不对其变化做出“反应”吗? {/*do-you-want-to-read-a-value-without-reacting-to-its-changes*/}
612612
613-
<<<<<<< HEAD
614-
<Canary>
615-
616-
**`useEffectEvent` API 当前仅在 React Canary 和 实验发行版中可用**。
617-
618-
[了解更多关于 React 版本发布的内容](/community/versioning-policy#all-release-channels)。
619-
620-
</Canary>
621-
622613
假设你希望在用户收到新消息时播放声音,`isMuted``true` 除外:
623-
=======
624-
Suppose that you want to play a sound when the user receives a new message unless `isMuted` is `true`:
625-
>>>>>>> f9e2c1396769bb5da87db60f9ff03683d18711e2
626614
627615
```js {3,10-12}
628616
function ChatRoom({ roomId }) {

0 commit comments

Comments
 (0)