Skip to content

Commit 9f91f3c

Browse files
committed
docs(en): merging all conflicts
2 parents eb8ce8b + d271a7a commit 9f91f3c

File tree

11 files changed

+43
-5
lines changed

11 files changed

+43
-5
lines changed

src/content/blog/2024/05/22/react-conf-2024-recap.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,11 @@ React 和 React Native 团队也在每天结束时进行了问答环节:
112112

113113
感谢 [Callstack](https://www.callstack.com/) 建设大会网站;感谢 [Kadi Kraman](https://twitter.com/kadikraman)[Expo](https://expo.dev/) 团队建设大会移动应用。
114114

115+
<<<<<<< HEAD
115116
感谢所有赞助商使本次活动得以实现:[Remix](https://remix.run/)[Amazon](https://developer.amazon.com/apps-and-games?cmp=US_2024_05_3P_React-Conf-2024&ch=prtnr&chlast=prtnr&pub=ref&publast=ref&type=org&typelast=org)[MUI](https://mui.com/)[Sentry](https://sentry.io/for/react/?utm_source=sponsored-conf&utm_medium=sponsored-event&utm_campaign=frontend-fy25q2-evergreen&utm_content=logo-reactconf2024-learnmore)[Abbott](https://www.jobs.abbott/software)[Expo](https://expo.dev/)[RedwoodJS](https://redwoodjs.com/) 以及 [Vercel](https://vercel.com)
117+
=======
118+
Thank you to all the sponsors who made the event possible: [Remix](https://remix.run/), [Amazon](https://developer.amazon.com/apps-and-games?cmp=US_2024_05_3P_React-Conf-2024&ch=prtnr&chlast=prtnr&pub=ref&publast=ref&type=org&typelast=org), [MUI](https://mui.com/), [Sentry](https://sentry.io/for/react/?utm_source=sponsored-conf&utm_medium=sponsored-event&utm_campaign=frontend-fy25q2-evergreen&utm_content=logo-reactconf2024-learnmore), [Abbott](https://www.jobs.abbott/software), [Expo](https://expo.dev/), [RedwoodJS](https://rwsdk.com/), and [Vercel](https://vercel.com).
119+
>>>>>>> d271a7ac11d2bf0d6e95ebdfacaf1038421f9be0
116120
117121
感谢音视频团队为我们提供的视觉、舞台和声音;感谢威斯汀酒店为我们提供的住宿。
118122

src/content/blog/2025/02/14/sunsetting-create-react-app.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ export default function Dashboard() {
177177
}
178178
```
179179

180+
<<<<<<< HEAD
180181
在副作用中获取数据意味着用户需要等待更长时间才能看到内容,即使这些数据本可以更早地获取。为了解决这个问题,你可以使用一些数据获取库,例如:[React Query](https://react-query.tanstack.com/)[SWR](https://swr.vercel.app/)[Apollo](https://www.apollographql.com/docs/react)[Relay](https://relay.dev/),这些库提供了预取数据的功能,使得请求可以在组件渲染之前就开始,从而减少用户等待时间并提升性能
182+
=======
183+
Fetching in an effect means the user has to wait longer to see the content, even though the data could have been fetched earlier. To solve this, you can use a data fetching library like [TanStack Query](https://tanstack.com/query/), [SWR](https://swr.vercel.app/), [Apollo](https://www.apollographql.com/docs/react), or [Relay](https://relay.dev/) which provide options to prefetch data so the request is started before the component renders.
184+
>>>>>>> d271a7ac11d2bf0d6e95ebdfacaf1038421f9be0
181185
182186
这些库在与路由的“loader”模式集成时效果最佳,可以在路由级别指定数据依赖关系,从而使路由器能够优化数据获取:
183187

src/content/learn/build-a-react-app-from-scratch.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ title: 从零开始构建 React 应用
3434
[Vite](https://vite.dev/) 是一个构建工具,旨在为现代网络项目提供更快更简洁的开发体验。
3535

3636
<TerminalBlock>
37-
{`npm create vite@latest my-app -- --template react`}
37+
{`npm create vite@latest my-app -- --template react-ts`}
3838
</TerminalBlock>
3939

4040
Vite 采用约定式设计,开箱即提供合理的默认配置。它拥有丰富的插件生态系统,能够支持快速热更新、JSX、Babel/SWC 等常见功能。你可以查看 Vite 的 [React 插件](https://vite.dev/plugins/#vitejs-plugin-react)[React SWC 插件](https://vite.dev/plugins/#vitejs-plugin-react-swc)[React 服务器端渲染示例项目](https://vite.dev/guide/ssr.html#example-projects) 来开始使用。
@@ -97,7 +97,7 @@ React 生态系统中包含许多用于解决这些问题的工具。我们列
9797

9898
如果你从大多数后端或 REST 风格的 API 获取数据,我们建议使用:
9999

100-
- [React Query](https://react-query.tanstack.com/)
100+
- [TanStack Query](https://tanstack.com/query/)
101101
- [SWR](https://swr.vercel.app/)
102102
- [RTK Query](https://redux-toolkit.js.org/rtk-query/overview)
103103

src/content/learn/choosing-the-state-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1718,7 +1718,7 @@ export const initialTravelPlan = {
17181718
34: {
17191719
id: 34,
17201720
title: 'Oceania',
1721-
childIds: [35, 36, 37, 38, 39, 40,, 41],
1721+
childIds: [35, 36, 37, 38, 39, 40, 41],
17221722
},
17231723
35: {
17241724
id: 35,

src/content/learn/creating-a-react-app.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ Expo 由 [Expo 公司](https://expo.dev/about) 维护。使用 Expo 构建应用
6363

6464
还有一些新兴的框架正在努力实现我们的全栈 React 愿景:
6565

66+
<<<<<<< HEAD
6667
- [TanStack Start (Beta)](https://tanstack.com/): TanStack Start 是一个由 TanStack Router 驱动的全栈 React 框架。它使用 Nitro 和 Vite 等工具提供完整的文档服务端渲染、流式传输、服务器函数、打包等功能。
6768
- [RedwoodJS](https://redwoodjs.com/): Redwood 是一个全栈 React 框架,带有许多预装的包和配置,方便构建全栈 Web 应用。
69+
=======
70+
- [TanStack Start (Beta)](https://tanstack.com/start/): TanStack Start is a full-stack React framework powered by TanStack Router. It provides a full-document SSR, streaming, server functions, bundling, and more using tools like Nitro and Vite.
71+
- [RedwoodSDK](https://rwsdk.com/): Redwood is a full stack React framework with lots of pre-installed packages and configuration that makes it easy to build full-stack web applications.
72+
>>>>>>> d271a7ac11d2bf0d6e95ebdfacaf1038421f9be0
6873
6974
<DeepDive>
7075

src/content/learn/synchronizing-with-effects.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,8 +732,13 @@ function TodoList() {
732732
733733
这些弊端并不仅限于 React。任何库在组件挂载时进行数据获取都会遇到这些问题。与路由处理一样,要做好数据获取并非易事,因此我们推荐以下方法:
734734
735+
<<<<<<< HEAD
735736
- **如果你正在使用 [框架](/learn/start-a-new-react-project#full-stack-frameworks) ,请使用其内置的数据获取机制**。现代 React 框架集成了高效的数据获取机制,不会出现上述问题。
736737
- **否则,请考虑使用或构建客户端缓存**。流行的开源解决方案包括 [React Query](https://tanstack.com/query/latest)、[useSWR](https://swr.vercel.app/) 和 [React Router v6.4+](https://beta.reactrouter.com/en/main/start/overview)。你也可以自己构建解决方案:在底层使用 Effect,但添加对请求的去重、缓存响应以及避免网络瀑布(通过预加载数据或将数据请求提升到路由层次)的逻辑。
738+
=======
739+
- **If you use a [framework](/learn/start-a-new-react-project#full-stack-frameworks), use its built-in data fetching mechanism.** Modern React frameworks have integrated data fetching mechanisms that are efficient and don't suffer from the above pitfalls.
740+
- **Otherwise, consider using or building a client-side cache.** Popular open source solutions include [TanStack Query](https://tanstack.com/query/latest), [useSWR](https://swr.vercel.app/), and [React Router 6.4+.](https://beta.reactrouter.com/en/main/start/overview) You can build your own solution too, in which case you would use Effects under the hood, but add logic for deduplicating requests, caching responses, and avoiding network waterfalls (by preloading data or hoisting data requirements to routes).
741+
>>>>>>> d271a7ac11d2bf0d6e95ebdfacaf1038421f9be0
737742
738743
如果这些方法都不适合你,你可以继续直接在 Effect 中获取数据。
739744

src/content/learn/you-might-not-need-an-effect.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ function Game() {
437437
// ✅ 在事件处理函数中计算剩下的所有 state
438438
setCard(nextCard);
439439
if (nextCard.gold) {
440-
if (goldCardCount <= 3) {
440+
if (goldCardCount < 3) {
441441
setGoldCardCount(goldCardCount + 1);
442442
} else {
443443
setGoldCardCount(0);

src/content/reference/eslint-plugin-react-hooks/lints/rules-of-hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ useEffect(() => {
132132

133133
<Note>
134134

135-
There are better ways to fetch data rather than in a useEffect. Consider using React Query, useSWR, or React Router 6.4+ for data fetching. These solutions handle deduplicating requests, caching responses, and avoiding network waterfalls.
135+
There are better ways to fetch data rather than in a useEffect. Consider using TanStack Query, useSWR, or React Router 6.4+ for data fetching. These solutions handle deduplicating requests, caching responses, and avoiding network waterfalls.
136136

137137
Learn more: [Fetching Data](/learn/synchronizing-with-effects#fetching-data)
138138

src/content/reference/react/act.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,11 @@ it.only('can render and update a counter', async () => {
152152

153153
## 疑难解答 {/*troubleshooting*/}
154154

155+
<<<<<<< HEAD
155156
### 出现错误 "The current testing environment is not configured to support act"(...)" {/*error-the-current-testing-environment-is-not-configured-to-support-act*/}
157+
=======
158+
### I'm getting an error: "The current testing environment is not configured to support act(...)" {/*error-the-current-testing-environment-is-not-configured-to-support-act*/}
159+
>>>>>>> d271a7ac11d2bf0d6e95ebdfacaf1038421f9be0
156160
157161
使用 `act` 需要在测试环境中设置 `global.IS_REACT_ACT_ENVIRONMENT=true` 。这是为了确保 `act` 仅在正确的环境中使用。
158162

src/content/reference/react/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,24 @@ React 参考文档分为以下内容:
2121

2222
## React DOM {/*react-dom*/}
2323

24+
<<<<<<< HEAD
2425
React-dom 仅支持在 web 应用程序中使用(在浏览器 DOM 环境中运行)。本节分为以下部分:
2526

2627
* [Hook](/reference/react-dom/hooks) —— 适用于在浏览器 DOM 环境中运行的 web 应用程序的 Hook。
2728
* [组件](/reference/react-dom/components) —— React 支持所有内置的 HTML 和 SVG 组件。
2829
* [API](/reference/react-dom) —— `react-dom` 包含仅在 web 应用程序中支持的方法。
2930
* [客户端 API](/reference/react-dom/client) —— `react-dom/client` API 允许在客户端(浏览器中)渲染 React 组件。
3031
* [服务端 API](/reference/react-dom/server) —— `react-dom/server` API 允许在服务器端将 React 组件渲染为 HTML。
32+
=======
33+
React DOM contains features that are only supported for web applications (which run in the browser DOM environment). This section is broken into the following:
34+
35+
* [Hooks](/reference/react-dom/hooks) - Hooks for web applications which run in the browser DOM environment.
36+
* [Components](/reference/react-dom/components) - React supports all of the browser built-in HTML and SVG components.
37+
* [APIs](/reference/react-dom) - The `react-dom` package contains methods supported only in web applications.
38+
* [Client APIs](/reference/react-dom/client) - The `react-dom/client` APIs let you render React components on the client (in the browser).
39+
* [Server APIs](/reference/react-dom/server) - The `react-dom/server` APIs let you render React components to HTML on the server.
40+
* [Static APIs](/reference/react-dom/static) - The `react-dom/static` APIs let you generate static HTML for React components.
41+
>>>>>>> d271a7ac11d2bf0d6e95ebdfacaf1038421f9be0
3142
3243

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

0 commit comments

Comments
 (0)