Skip to content

Commit 048ca4a

Browse files
authored
Merge pull request #585 from reactjs/sync-c003ac4e
2 parents 4dffa0f + aa79071 commit 048ca4a

19 files changed

+161
-59
lines changed

.github/workflows/analyze.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ jobs:
1111
analyze:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

1616
- name: Set up node
17-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v3
1818
with:
1919
node-version: '20.x'
2020

2121
- name: Install dependencies
2222
uses: bahmutov/[email protected]
2323

2424
- name: Restore next build
25-
uses: actions/cache@v2
25+
uses: actions/cache@v3
2626
id: restore-build-cache
2727
env:
2828
cache-name: cache-next-build
@@ -41,7 +41,7 @@ jobs:
4141
run: npx -p [email protected] report
4242

4343
- name: Upload bundle
44-
uses: actions/upload-artifact@v2
44+
uses: actions/upload-artifact@v3
4545
with:
4646
path: .next/analyze/__bundle_analysis.json
4747
name: bundle_analysis.json
@@ -73,7 +73,7 @@ jobs:
7373
run: ls -laR .next/analyze/base && npx -p nextjs-bundle-analysis compare
7474

7575
- name: Upload analysis comment
76-
uses: actions/upload-artifact@v2
76+
uses: actions/upload-artifact@v3
7777
with:
7878
name: analysis_comment.txt
7979
path: .next/analyze/__bundle_analysis_comment.txt
@@ -82,7 +82,7 @@ jobs:
8282
run: echo ${{ github.event.number }} > ./pr_number
8383

8484
- name: Upload PR number
85-
uses: actions/upload-artifact@v2
85+
uses: actions/upload-artifact@v3
8686
with:
8787
name: pr_number
8888
path: ./pr_number

src/components/Layout/Footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export function Footer() {
283283
<div
284284
className="text-xs text-left rtl:text-right mt-2 pe-0.5"
285285
dir="ltr">
286-
&copy;{new Date().getFullYear()}
286+
Copyright &copy; Meta Platforms, Inc
287287
</div>
288288
<div
289289
className="uwu-visible text-xs cursor-pointer hover:text-link hover:dark:text-link-dark hover:underline"

src/content/blog/2023/03/16/introducing-react-dev.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ Use the conditional operator (`cond ? a : b`) to render a ❌ if `isPacked` isn
269269
function Item({ name, isPacked }) {
270270
return (
271271
<li className="item">
272-
{name} {isPacked && ''}
272+
{name} {isPacked && ''}
273273
</li>
274274
);
275275
}
@@ -307,7 +307,7 @@ export default function PackingList() {
307307
function Item({ name, isPacked }) {
308308
return (
309309
<li className="item">
310-
{name} {isPacked ? '' : ''}
310+
{name} {isPacked ? '' : ''}
311311
</li>
312312
);
313313
}

src/content/community/conferences.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,6 @@ Do you know of a local React.js conference? Add it here! (Please keep the list c
1010

1111
## Upcoming Conferences {/*upcoming-conferences*/}
1212

13-
### React Nexus 2024 {/*react-nexus-2024*/}
14-
July 04 & 05, 2024. Bangalore, India (In-person event)
15-
16-
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
17-
18-
### Chain React 2024 {/*chain-react-2024*/}
19-
July 17-19, 2024. In-person in Portland, OR, USA
20-
21-
[Website](https://chainreactconf.com) - [Twitter](https://twitter.com/ChainReactConf)
22-
23-
### The Geek Conf 2024 {/*the-geek-conf-2024*/}
24-
July 25, 2024. In-person in Berlin, Germany + remote (hybrid event)
25-
26-
[Website](https://thegeekconf.com) - [Twitter](https://twitter.com/thegeekconf)
27-
28-
### React Rally 2024 🐙 {/*react-rally-2024*/}
29-
August 12-13, 2024. Park City, UT, USA
30-
31-
[Website](https://reactrally.com) - [Twitter](https://twitter.com/ReactRally) - [YouTube](https://www.youtube.com/channel/UCXBhQ05nu3L1abBUGeQ0ahw)
32-
3313
### React Universe Conf 2024 {/*react-universe-conf-2024*/}
3414
September 5-6, 2024. Wrocław, Poland.
3515

@@ -55,13 +35,48 @@ October 18, 2024. In-person in Brussels, Belgium (hybrid event)
5535

5636
[Website](https://www.react.brussels/) - [Twitter](https://x.com/BrusselsReact)
5737

38+
### React Advanced London 2024 {/*react-advanced-london-2024*/}
39+
October 25 & 28, 2024. In-person in London, UK + online (hybrid event)
40+
41+
[Website](https://reactadvanced.com/) - [Twitter](https://x.com/reactadvanced)
42+
43+
### React Summit US 2024 {/*react-summit-us-2024*/}
44+
November 19 & 22, 2024. In-person in New York, USA + online (hybrid event)
45+
46+
[Website](https://reactsummit.us/) - [Twitter](https://twitter.com/reactsummit) - [Videos](https://portal.gitnation.org/)
47+
5848
### React Africa 2024 {/*react-africa-2024*/}
5949
November 29, 2024. In-person in Casablanca, Morocco (hybrid event)
6050

6151
[Website](https://react-africa.com/) - [Twitter](https://x.com/BeJS_)
6252

53+
### React Day Berlin 2024 {/*react-day-berlin-2024*/}
54+
December 13 & 16, 2024. In-person in Berlin, Germany + remote (hybrid event)
55+
56+
[Website](https://reactday.berlin/) - [Twitter](https://x.com/reactdayberlin)
57+
6358
## Past Conferences {/*past-conferences*/}
6459

60+
### React Rally 2024 🐙 {/*react-rally-2024*/}
61+
August 12-13, 2024. Park City, UT, USA
62+
63+
[Website](https://reactrally.com) - [Twitter](https://twitter.com/ReactRally) - [YouTube](https://www.youtube.com/channel/UCXBhQ05nu3L1abBUGeQ0ahw)
64+
65+
### The Geek Conf 2024 {/*the-geek-conf-2024*/}
66+
July 25, 2024. In-person in Berlin, Germany + remote (hybrid event)
67+
68+
[Website](https://thegeekconf.com) - [Twitter](https://twitter.com/thegeekconf)
69+
70+
### Chain React 2024 {/*chain-react-2024*/}
71+
July 17-19, 2024. In-person in Portland, OR, USA
72+
73+
[Website](https://chainreactconf.com) - [Twitter](https://twitter.com/ChainReactConf)
74+
75+
### React Nexus 2024 {/*react-nexus-2024*/}
76+
July 04 & 05, 2024. Bangalore, India (In-person event)
77+
78+
[Website](https://reactnexus.com/) - [Twitter](https://twitter.com/ReactNexus) - [Linkedin](https://www.linkedin.com/company/react-nexus) - [YouTube](https://www.youtube.com/reactify_in)
79+
6580
### React Summit 2024 {/*react-summit-2024*/}
6681
June 14 & 18, 2024. In-person in Amsterdam, Netherlands + remote (hybrid event)
6782

src/content/learn/conditional-rendering.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ export default function PackingList() {
5252
5353
</Sandpack>
5454
55-
لاحظ أن بعض مكونات `Item` لديها خاصية `isPacked` معينة إلى `true` بدلا من `false`. ترغب في إضافة علامة التحقق () إلى العناصر المحزومة في حالة `isPacked={true}`.
55+
لاحظ أن بعض مكونات `Item` لديها خاصية `isPacked` معينة إلى `true` بدلا من `false`. ترغب في إضافة علامة التحقق () إلى العناصر المحزومة في حالة `isPacked={true}`.
5656
5757
يمكنك كتابة ذلك باستخدام [عبارة `if`/`else`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/if...else) على النحو التالي:
5858
5959
```js
6060
if (isPacked) {
61-
return <li className="item">{name} </li>;
61+
return <li className="item">{name} </li>;
6262
}
6363
return <li className="item">{name}</li>;
6464
```
@@ -70,7 +70,7 @@ return <li className="item">{name}</li>;
7070
```js
7171
function Item({ name, isPacked }) {
7272
if (isPacked) {
73-
return <li className="item">{name} </li>;
73+
return <li className="item">{name} </li>;
7474
}
7575
return <li className="item">{name}</li>;
7676
}
@@ -159,7 +159,7 @@ export default function PackingList() {
159159
في المثال السابق، تحكمت في شجرة JSX (إن وجدت!) التي سيُرجعها المكون. ربما لاحظت بالفعل بعض التكرار في ناتج العرض:
160160
161161
```js
162-
<li className="item">{name} </li>
162+
<li className="item">{name} </li>
163163
```
164164
165165
مشابه جدًا لـ
@@ -172,7 +172,7 @@ export default function PackingList() {
172172
173173
```js
174174
if (isPacked) {
175-
return <li className="item">{name} </li>;
175+
return <li className="item">{name} </li>;
176176
}
177177
return <li className="item">{name}</li>;
178178
```
@@ -187,7 +187,7 @@ return <li className="item">{name}</li>;
187187
188188
```js
189189
if (isPacked) {
190-
return <li className="item">{name} </li>;
190+
return <li className="item">{name} </li>;
191191
}
192192
return <li className="item">{name}</li>;
193193
```
@@ -197,12 +197,12 @@ return <li className="item">{name}</li>;
197197
```js
198198
return (
199199
<li className="item">
200-
{isPacked ? name + ' ' : name}
200+
{isPacked ? name + ' ' : name}
201201
</li>
202202
);
203203
```
204204
205-
يمكنك قرائتها على النحو التالي *”إذا كان `isPacked` صحيحا، إذا قم بعرض `name + ' '`، وإلا (`:`) قم بعرض `name`“.*
205+
يمكنك قرائتها على النحو التالي *”إذا كان `isPacked` صحيحا، إذا قم بعرض name + ' '`، وإلا (`:`) قم بعرض `name`“.*
206206
207207
<DeepDive>
208208
@@ -222,7 +222,7 @@ function Item({ name, isPacked }) {
222222
<li className="item">
223223
{isPacked ? (
224224
<del>
225-
{name + ' '}
225+
{name + ' '}
226226
</del>
227227
) : (
228228
name
@@ -265,7 +265,7 @@ export default function PackingList() {
265265
```js
266266
return (
267267
<li className="item">
268-
{name} {isPacked && ''}
268+
{name} {isPacked && ''}
269269
</li>
270270
);
271271
```
@@ -280,7 +280,7 @@ return (
280280
function Item({ name, isPacked }) {
281281
return (
282282
<li className="item">
283-
{name} {isPacked && ''}
283+
{name} {isPacked && ''}
284284
</li>
285285
);
286286
}
@@ -336,7 +336,7 @@ let itemContent = name;
336336
337337
```js
338338
if (isPacked) {
339-
itemContent = name + " ";
339+
itemContent = name + " ";
340340
}
341341
```
342342
@@ -356,7 +356,7 @@ if (isPacked) {
356356
function Item({ name, isPacked }) {
357357
let itemContent = name;
358358
if (isPacked) {
359-
itemContent = name + " ";
359+
itemContent = name + " ";
360360
}
361361
return (
362362
<li className="item">
@@ -400,7 +400,7 @@ function Item({ name, isPacked }) {
400400
if (isPacked) {
401401
itemContent = (
402402
<del>
403-
{name + " "}
403+
{name + " "}
404404
</del>
405405
);
406406
}
@@ -461,7 +461,7 @@ export default function PackingList() {
461461
function Item({ name, isPacked }) {
462462
return (
463463
<li className="item">
464-
{name} {isPacked && ''}
464+
{name} {isPacked && ''}
465465
</li>
466466
);
467467
}
@@ -499,7 +499,7 @@ export default function PackingList() {
499499
function Item({ name, isPacked }) {
500500
return (
501501
<li className="item">
502-
{name} {isPacked ? '' : ''}
502+
{name} {isPacked ? '' : ''}
503503
</li>
504504
);
505505
}

src/content/learn/describing-the-ui.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export function getImageUrl(person, size = 's') {
326326
function Item({ name, isPacked }) {
327327
return (
328328
<li className="item">
329-
{name} {isPacked && ''}
329+
{name} {isPacked && ''}
330330
</li>
331331
);
332332
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ function Game() {
408408
409409
There are two problems with this code.
410410
411-
One problem is that it is very inefficient: the component (and its children) have to re-render between each `set` call in the chain. In the example above, in the worst case (`setCard` → render → `setGoldCardCount` → render → `setRound` → render → `setIsGameOver` → render) there are three unnecessary re-renders of the tree below.
411+
The first problem is that it is very inefficient: the component (and its children) have to re-render between each `set` call in the chain. In the example above, in the worst case (`setCard` → render → `setGoldCardCount` → render → `setRound` → render → `setIsGameOver` → render) there are three unnecessary re-renders of the tree below.
412412
413-
Even if it weren't slow, as your code evolves, you will run into cases where the "chain" you wrote doesn't fit the new requirements. Imagine you are adding a way to step through the history of the game moves. You'd do it by updating each state variable to a value from the past. However, setting the `card` state to a value from the past would trigger the Effect chain again and change the data you're showing. Such code is often rigid and fragile.
413+
The second problem is that even if it weren't slow, as your code evolves, you will run into cases where the "chain" you wrote doesn't fit the new requirements. Imagine you are adding a way to step through the history of the game moves. You'd do it by updating each state variable to a value from the past. However, setting the `card` state to a value from the past would trigger the Effect chain again and change the data you're showing. Such code is often rigid and fragile.
414414
415415
In this case, it's better to calculate what you can during rendering, and adjust the state in the event handler:
416416

src/content/reference/react-dom/components/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ They are special in React because passing the `value` prop to them makes them *[
3434

3535
## Resource and Metadata Components {/*resource-and-metadata-components*/}
3636

37-
These bulit-in browser components let you load external resources or annotate the document with metadata:
37+
These built-in browser components let you load external resources or annotate the document with metadata:
3838

3939
* [`<link>`](/reference/react-dom/components/link)
4040
* [`<meta>`](/reference/react-dom/components/meta)

src/content/reference/react/cache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ By caching a long-running data fetch, you can kick off asynchronous work prior t
226226
```jsx [[2, 6, "await getUser(id)"], [1, 17, "getUser(id)"]]
227227
const getUser = cache(async (id) => {
228228
return await db.user.query(id);
229-
})
229+
});
230230

231231
async function Profile({id}) {
232232
const user = await getUser(id);
@@ -327,7 +327,7 @@ In general, you should use [`useMemo`](/reference/react/useMemo) for caching a e
327327
'use client';
328328

329329
function WeatherReport({record}) {
330-
const avgTemp = useMemo(() => calculateAvg(record)), record);
330+
const avgTemp = useMemo(() => calculateAvg(record), record);
331331
// ...
332332
}
333333

src/content/reference/react/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ The React reference documentation is broken down into functional subsections:
1515
Programmatic React features:
1616

1717
* [Hooks](/reference/react/hooks) - Use different React features from your components.
18-
* [Components](/reference/react/components) - Documents built-in components that you can use in your JSX.
18+
* [Components](/reference/react/components) - Built-in components that you can use in your JSX.
1919
* [APIs](/reference/react/apis) - APIs that are useful for defining components.
2020
* [Directives](/reference/rsc/directives) - Provide instructions to bundlers compatible with React Server Components.
2121

src/content/reference/react/lazy.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Now that your component's code loads on demand, you also need to specify what sh
7878
<Suspense fallback={<Loading />}>
7979
<h2>Preview</h2>
8080
<MarkdownPreview />
81-
</Suspense>
81+
</Suspense>
8282
```
8383

8484
In this example, the code for `MarkdownPreview` won't be loaded until you attempt to render it. If `MarkdownPreview` hasn't loaded yet, `Loading` will be shown in its place. Try ticking the checkbox:

src/content/reference/react/useCallback.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ function ChatRoom({ roomId }) {
711711

712712
useEffect(() => {
713713
const options = createOptions();
714-
const connection = createConnection();
714+
const connection = createConnection(options);
715715
connection.connect();
716716
// ...
717717
```
@@ -722,7 +722,7 @@ This creates a problem. [Every reactive value must be declared as a dependency o
722722
```js {6}
723723
useEffect(() => {
724724
const options = createOptions();
725-
const connection = createConnection();
725+
const connection = createConnection(options);
726726
connection.connect();
727727
return () => connection.disconnect();
728728
}, [createOptions]); // 🔴 Problem: This dependency changes on every render
@@ -744,7 +744,7 @@ function ChatRoom({ roomId }) {
744744

745745
useEffect(() => {
746746
const options = createOptions();
747-
const connection = createConnection();
747+
const connection = createConnection(options);
748748
connection.connect();
749749
return () => connection.disconnect();
750750
}, [createOptions]); // ✅ Only changes when createOptions changes
@@ -766,7 +766,7 @@ function ChatRoom({ roomId }) {
766766
}
767767

768768
const options = createOptions();
769-
const connection = createConnection();
769+
const connection = createConnection(options);
770770
connection.connect();
771771
return () => connection.disconnect();
772772
}, [roomId]); // ✅ Only changes when roomId changes

0 commit comments

Comments
 (0)