Skip to content

Commit 749d8de

Browse files
authored
docs(en): merge reactjs.org/main into zh-hans.reactjs.org/main @ 50d6991 (#1728)
2 parents 471033d + 981c9cf commit 749d8de

27 files changed

+174
-155
lines changed

.github/workflows/analyze_comment.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ on:
66
types:
77
- completed
88

9+
permissions:
10+
contents: read
11+
issues: write
12+
pull-requests: write
13+
914
jobs:
1015
comment:
1116
runs-on: ubuntu-latest

src/components/Layout/HomeContent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1153,7 +1153,7 @@ async function Talks({ confId }) {
11531153
</CodeBlock>
11541154
}
11551155
right={
1156-
<NavContext.Provider value={{slug, navigate}}>
1156+
<NavContext value={{slug, navigate}}>
11571157
<BrowserChrome
11581158
domain="example.com"
11591159
path={'confs/' + slug}
@@ -1173,7 +1173,7 @@ async function Talks({ confId }) {
11731173
</Suspense>
11741174
</ExamplePanel>
11751175
</BrowserChrome>
1176-
</NavContext.Provider>
1176+
</NavContext>
11771177
}
11781178
/>
11791179
);

src/components/Layout/Page.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ export function Page({
8282
'max-w-7xl mx-auto',
8383
section === 'blog' && 'lg:flex lg:flex-col lg:items-center'
8484
)}>
85-
<TocContext.Provider value={toc}>
86-
<LanguagesContext.Provider value={languages}>
87-
{children}
88-
</LanguagesContext.Provider>
89-
</TocContext.Provider>
85+
<TocContext value={toc}>
86+
<LanguagesContext value={languages}>{children}</LanguagesContext>
87+
</TocContext>
9088
</div>
9189
{!isBlogIndex && (
9290
<DocsPageFooter

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/components/MDX/MDXComponents.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ function IllustrationBlock({
354354
</figure>
355355
));
356356
return (
357-
<IllustrationContext.Provider value={isInBlockTrue}>
357+
<IllustrationContext value={isInBlockTrue}>
358358
<div className="relative group before:absolute before:-inset-y-16 before:inset-x-0 my-16 mx-0 2xl:mx-auto max-w-4xl 2xl:max-w-6xl">
359359
{sequential ? (
360360
<ol className="mdx-illustration-block flex">
@@ -369,7 +369,7 @@ function IllustrationBlock({
369369
)}
370370
<AuthorCredit author={author} authorLink={authorLink} />
371371
</div>
372-
</IllustrationContext.Provider>
372+
</IllustrationContext>
373373
);
374374
}
375375

src/content/blog/2024/12/05/react-19.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ function MyInput({placeholder, ref}) {
410410

411411
<Note>
412412

413-
在类组件中,`ref` 不作为 props 传递,因为它们引用的是组件实例。这意味着,如果你在类组件中需要访问 `ref`,你需要使用 `React.forwardRef` 或者 `React.createRef`
413+
在类组件中,`ref` 不作为 props 传递,因为它们引用的是组件实例。
414414

415415
</Note>
416416

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+
>>>>>>> 50d6991ca6652f4bc4c985cf0c0e593864f2cc91
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/managing-state.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -744,9 +744,9 @@ export default function Section({ children }) {
744744
const level = useContext(LevelContext);
745745
return (
746746
<section className="section">
747-
<LevelContext.Provider value={level + 1}>
747+
<LevelContext value={level + 1}>
748748
{children}
749-
</LevelContext.Provider>
749+
</LevelContext>
750750
</section>
751751
);
752752
}
@@ -839,13 +839,11 @@ export function TasksProvider({ children }) {
839839
);
840840

841841
return (
842-
<TasksContext.Provider value={tasks}>
843-
<TasksDispatchContext.Provider
844-
value={dispatch}
845-
>
842+
<TasksContext value={tasks}>
843+
<TasksDispatchContext value={dispatch}>
846844
{children}
847-
</TasksDispatchContext.Provider>
848-
</TasksContext.Provider>
845+
</TasksDispatchContext>
846+
</TasksContext>
849847
);
850848
}
851849

0 commit comments

Comments
 (0)