Skip to content

Commit 6cd3d78

Browse files
committed
docs(en): merging all conflicts
2 parents 1fa1a78 + e901790 commit 6cd3d78

9 files changed

Lines changed: 53 additions & 14 deletions

File tree

src/components/Layout/TopNav/TopNav.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,9 @@ export default function TopNav({
266266
<BrandMenu>
267267
<div className="flex items-center">
268268
<div className="uwu-visible flex items-center justify-center h-full">
269-
<NextLink href="/">
269+
<NextLink
270+
href="/"
271+
className="active:scale-95 transition-transform">
270272
<Image
271273
alt="logo by @sawaratsuki1004"
272274
title="logo by @sawaratsuki1004"

src/content/community/conferences.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ September 2-4, 2025. Wrocław, Poland.
4545

4646
[Website](https://www.reactuniverseconf.com/) - [Twitter](https://twitter.com/react_native_eu) - [LinkedIn](https://www.linkedin.com/events/reactuniverseconf7163919537074118657/)
4747

48+
### React Alicante 2025 {/*react-alicante-2025*/}
49+
October 2-4, 2025. Alicante, Spain.
50+
51+
[Website](https://reactalicante.es/) - [Twitter](https://x.com/ReactAlicante) - [Bluesky](https://bsky.app/profile/reactalicante.es) - [YouTube](https://www.youtube.com/channel/UCaSdUaITU1Cz6PvC97A7e0w)
52+
4853
### React Conf 2025 {/*react-conf-2025*/}
4954
October 7-8, 2025. Henderson, Nevada, USA and free livestream
5055

src/content/community/meetups.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ Do you have a local React.js meetup? Add it here! (Please keep the list alphabet
8888
* [Delhi NCR](https://www.meetup.com/React-Delhi-NCR/)
8989
* [Mumbai](https://reactmumbai.dev)
9090
* [Pune](https://www.meetup.com/ReactJS-and-Friends/)
91+
* [Rajasthan](https://reactrajasthan.com)
9192

9293
## Indonesia {/*indonesia*/}
9394
* [Indonesia](https://www.meetup.com/reactindonesia/)

src/content/learn/keeping-components-pure.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function Cup({ guest }) {
179179
}
180180

181181
export default function TeaGathering() {
182-
let cups = [];
182+
const cups = [];
183183
for (let i = 1; i <= 12; i++) {
184184
cups.push(<Cup key={i} guest={i} />);
185185
}
@@ -249,7 +249,7 @@ export default function TeaGathering() {
249249

250250
```js src/Clock.js active
251251
export default function Clock({ time }) {
252-
let hours = time.getHours();
252+
const hours = time.getHours();
253253
if (hours >= 0 && hours <= 6) {
254254
document.getElementById('time').className = 'night';
255255
} else {
@@ -311,7 +311,7 @@ body > * {
311311

312312
```js src/Clock.js active
313313
export default function Clock({ time }) {
314-
let hours = time.getHours();
314+
const hours = time.getHours();
315315
let className;
316316
if (hours >= 0 && hours <= 6) {
317317
className = 'night';
@@ -610,14 +610,14 @@ export default function StoryTray({ stories }) {
610610
import { useState, useEffect } from 'react';
611611
import StoryTray from './StoryTray.js';
612612

613-
let initialStories = [
613+
const initialStories = [
614614
{id: 0, label: "Ankit's Story" },
615615
{id: 1, label: "Taylor's Story" },
616616
];
617617

618618
export default function App() {
619-
let [stories, setStories] = useState([...initialStories])
620-
let time = useTime();
619+
const [stories, setStories] = useState([...initialStories])
620+
const time = useTime();
621621

622622
// 临时解决方案:防止在阅读文档时内存无限制增长。
623623
// 我们在这里违反了自己的规则。
@@ -706,14 +706,14 @@ export default function StoryTray({ stories }) {
706706
import { useState, useEffect } from 'react';
707707
import StoryTray from './StoryTray.js';
708708

709-
let initialStories = [
709+
const initialStories = [
710710
{id: 0, label: "Ankit's Story" },
711711
{id: 1, label: "Taylor's Story" },
712712
];
713713

714714
export default function App() {
715-
let [stories, setStories] = useState([...initialStories])
716-
let time = useTime();
715+
const [stories, setStories] = useState([...initialStories])
716+
const time = useTime();
717717

718718
// 临时解决方案:防止在阅读文档时内存无限制增长。
719719
// 我们在这里违反了自己的规则。
@@ -773,8 +773,13 @@ li {
773773

774774
```js src/StoryTray.js active
775775
export default function StoryTray({ stories }) {
776+
<<<<<<< HEAD
776777
// 复制数组!
777778
let storiesToDisplay = stories.slice();
779+
=======
780+
// Copy the array!
781+
const storiesToDisplay = stories.slice();
782+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
778783

779784
// 不影响原始数组:
780785
storiesToDisplay.push({
@@ -798,14 +803,14 @@ export default function StoryTray({ stories }) {
798803
import { useState, useEffect } from 'react';
799804
import StoryTray from './StoryTray.js';
800805

801-
let initialStories = [
806+
const initialStories = [
802807
{id: 0, label: "Ankit's Story" },
803808
{id: 1, label: "Taylor's Story" },
804809
];
805810

806811
export default function App() {
807-
let [stories, setStories] = useState([...initialStories])
808-
let time = useTime();
812+
const [stories, setStories] = useState([...initialStories])
813+
const time = useTime();
809814

810815
// 临时解决方案:防止在阅读文档时内存无限制增长。
811816
// 我们在这里违反了自己的规则。

src/content/learn/preserving-and-resetting-state.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,11 @@ label {
676676

677677
</Sandpack>
678678

679+
<<<<<<< HEAD
679680
当你勾选复选框后计数器的 state 被重置了。虽然你渲染了一个 `Counter`,但是 `div` 的第一个子组件从 `div` 变成了 `section`。当子组件 `div` 从 DOM 中被移除的时候,它底下的整棵树(包含 `Counter` 以及它的 state)也都被销毁了。
681+
=======
682+
The counter state gets reset when you click the checkbox. Although you render a `Counter`, the first child of the `div` changes from a `section` to a `div`. When the child `section` was removed from the DOM, the whole tree below it (including the `Counter` and its state) was destroyed as well.
683+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
680684
681685
<DiagramGroup>
682686

src/content/learn/referencing-values-with-refs.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,11 @@ export default function Toggle() {
467467

468468
#### 修复防抖 {/*fix-debouncing*/}
469469

470+
<<<<<<< HEAD
470471
在这个例子中,所有按钮点击处理器都是 ["防抖的"](https://redd.one/blog/debounce-vs-throttle)。 要了解这意味着什么,请按下其中一个按钮。注意消息在一秒后显示。如果你在等待消息时按下按钮,计时器将重置。因此如果你多次快速单击同一个按钮,则直到你停止单击 **之后** 1 秒钟,该消息才会显示。防抖可以让你将一些动作推迟到用户“停止动作”之后。
472+
=======
473+
In this example, all button click handlers are ["debounced".](https://kettanaito.com/blog/debounce-vs-throttle) To see what this means, press one of the buttons. Notice how the message appears a second later. If you press the button while waiting for the message, the timer will reset. So if you keep clicking the same button fast many times, the message won't appear until a second *after* you stop clicking. Debouncing lets you delay some action until the user "stops doing things".
474+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
471475
472476
这个例子可以正常运行,但并不完全符合预期。按钮不是独立的。要查看问题,请单击其中一个按钮,然后立即单击另一个按钮。你本来期望在延迟之后,你会看到两个按钮的消息。但只有最后一个按钮的消息出现了。第一个按钮的消息丢失了。
473477

src/content/reference/react-dom/createPortal.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,11 @@ export default function ModalContent({ onClose }) {
240240
241241
使用 portal 时,确保应用程序的无障碍性非常重要。例如,你可能需要管理键盘焦点,以便用户可以自然进出 portal。
242242
243+
<<<<<<< HEAD
243244
创建模态对话框时,请遵循 [WAI-ARIA 模态实践指南](https://www.w3.org/WAI/ARIA/apg/#dialog_modal)。如果你使用了社区包,请确保它具有无障碍性,并遵循这些指南。
245+
=======
246+
Follow the [WAI-ARIA Modal Authoring Practices](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal) when creating modals. If you use a community package, ensure that it is accessible and follows these guidelines.
247+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
244248
245249
</Pitfall>
246250

src/content/reference/rsc/server-functions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ To support Server Functions as a bundler or framework, we recommend pinning to a
2828

2929
</Note>
3030

31-
When a Server Function is defined with the [`"use server"`](/reference/rsc/use-server) directive, your framework will automatically create a reference to the server function, and pass that reference to the Client Component. When that function is called on the client, React will send a request to the server to execute the function, and return the result.
31+
When a Server Function is defined with the [`"use server"`](/reference/rsc/use-server) directive, your framework will automatically create a reference to the Server Function, and pass that reference to the Client Component. When that function is called on the client, React will send a request to the server to execute the function, and return the result.
3232

3333
Server Functions can be created in Server Components and passed as props to Client Components, or they can be imported and used in Client Components.
3434

src/content/reference/rules/components-and-hooks-must-be-pure.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,13 @@ function ProductDetailPage({ product }) {
206206

207207
你可以将 props 和 state 视为在渲染后更新的快照。因此,你不会直接修改 props 或 state,相反,你传递新的 props,或者使用提供给你的 setter 函数来告诉 React,state 需要在下一次组件渲染时更新。
208208

209+
<<<<<<< HEAD
209210
### 不要修改 props {/*props*/}
210211
props 是不可变的,因为如果你改变了它们,应用程序可能会产生不一致的结果,这会让调试变得困难,因为程序可能会在某些情况下工作,而在另一些情况下不工作。
212+
=======
213+
### Don't mutate Props {/*props*/}
214+
Props are immutable because if you mutate them, the application will produce inconsistent output, which can be hard to debug as it may or may not work depending on the circumstances.
215+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
211216
212217
```js {2}
213218
function Post({ item }) {
@@ -306,7 +311,12 @@ function useIconStyle(icon) {
306311
}, [icon, theme]);
307312
}
308313
```
314+
<<<<<<< HEAD
309315
如果你改变了 Hook 的参数,那么自定义 Hook 的缓存(memoization)就会变得不正确,因此避免这样做非常重要。
316+
=======
317+
318+
If you were to mutate the Hook's arguments, the custom hook's memoization will become incorrect, so it's important to avoid doing that.
319+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
310320
311321
```js {4}
312322
style = useIconStyle(icon); // `style` 是基于 `icon` 进行记忆化的
@@ -326,7 +336,11 @@ style = useIconStyle(icon); // 计算 `style` 的新值
326336

327337
## 不要改变传递给 JSX 后的值 {/*values-are-immutable-after-being-passed-to-jsx*/}
328338

339+
<<<<<<< HEAD
329340
不要在 JSX 使用过值之后改变它们。应该在创建 JSX 之前完成值的更改。
341+
=======
342+
Don't mutate values after they've been used in JSX. Move the mutation to before the JSX is created.
343+
>>>>>>> e90179047b1e7dd1ef19a37eed52765d8e04c484
330344
331345
当你在表达式中使用 JSX 时,React 可能会在组件完成渲染之前就急于计算 JSX。这意味着,如果在将值传递给 JSX 之后对它们进行更改,可能会导致 UI 过时,因为 React 不会知道需要更新组件的输出。
332346

0 commit comments

Comments
 (0)