Skip to content

Commit d158002

Browse files
Merge pull request #251 from reactjs/sync-2390627c
Sync with react.dev @ 2390627
2 parents 9a63bbf + 2e414ac commit d158002

17 files changed

+20
-44
lines changed

Diff for: public/images/team/dave-mccabe.jpg

-203 KB
Binary file not shown.

Diff for: public/images/team/lunaruan.jpg

-150 KB
Binary file not shown.

Diff for: public/images/team/mengdi-chen.jpg

-106 KB
Binary file not shown.

Diff for: public/images/team/sean-keegan.jpg

-199 KB
Binary file not shown.

Diff for: src/components/Layout/HomeContent.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1654,8 +1654,8 @@ function LikeButton({video}) {
16541654
<button
16551655
data-hover="LikeButton"
16561656
className={cn(
1657-
'outline-none focus:bg-red-50/5 focus:text-red-50 relative flex items-center justify-center w-10 h-10 cursor-pointer rounded-full text-tertiary hover:bg-card active:scale-95 active:bg-red-50/5 active:text-red-50',
1658-
isLiked && 'text-red-50'
1657+
'outline-none focus:bg-red-50/5 focus:text-red-50 relative flex items-center justify-center w-10 h-10 cursor-pointer rounded-full hover:bg-card active:scale-95 active:bg-red-50/5 active:text-red-50',
1658+
isLiked ? 'text-red-50' : 'text-tertiary'
16591659
)}
16601660
aria-label={isLiked ? 'Unsave' : 'Save'}
16611661
onClick={() => {

Diff for: src/components/Layout/Toc.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ export function Toc({headings}: {headings: Toc}) {
2727
<ul className="space-y-2 pb-16">
2828
{headings.length > 0 &&
2929
headings.map((h, i) => {
30-
if (h.url == null) {
31-
// TODO: only log in DEV
30+
if (!h.url && process.env.NODE_ENV === 'development') {
3231
console.error('Heading does not have URL');
3332
}
3433
return (

Diff for: src/components/Seo.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,12 @@ const deployedTranslations = [
2121
'en',
2222
'zh-hans',
2323
'es',
24+
'fr',
2425
// We'll add more languages when they have enough content.
2526
// Please DO NOT edit this list without a discussion in the reactjs/react.dev repo.
2627
// It must be the same between all translations.
2728
];
2829

29-
let shouldPreventIndexing = false;
30-
if (
31-
siteConfig.languageCode !== 'en' &&
32-
!deployedTranslations.includes(siteConfig.languageCode)
33-
) {
34-
shouldPreventIndexing = true;
35-
}
36-
3730
function getDomain(languageCode: string): string {
3831
const subdomain = languageCode === 'en' ? '' : languageCode + '.';
3932
return subdomain + 'react.dev';
@@ -69,7 +62,6 @@ export const Seo = withRouter(
6962
href={canonicalUrl.replace(siteDomain, getDomain('en'))}
7063
hrefLang="x-default"
7164
/>
72-
{shouldPreventIndexing && <meta name="robots" content="noindex" />}
7365
{deployedTranslations.map((languageCode) => (
7466
<link
7567
key={'alt-' + languageCode}

Diff for: src/content/community/acknowledgements.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ We'd like to recognize a few people who have made significant contributions to R
2424
* [Christoph Nakazawa](https://github.com/cpojer)
2525
* [Christopher Chedeau](https://github.com/vjeux)
2626
* [Clement Hoang](https://github.com/clemmy)
27+
* [Dave McCabe](https://github.com/davidmccabe)
2728
* [Dominic Gannaway](https://github.com/trueadm)
2829
* [Flarnie Marchan](https://github.com/flarnie)
2930
* [Jason Quense](https://github.com/jquense)
@@ -33,8 +34,10 @@ We'd like to recognize a few people who have made significant contributions to R
3334
* [Josh Duck](https://github.com/joshduck)
3435
* [Joe Critchley](https://github.com/joecritch)
3536
* [Jeff Morrison](https://github.com/jeffmo)
37+
* [Luna Ruan](https://github.com/lunaruan)
3638
* [Keyan Zhang](https://github.com/keyz)
3739
* [Marco Salazar](https://github.com/salazarm)
40+
* [Mengdi Chen](https://github.com/mondaychen)
3841
* [Nat Alison](https://github.com/tesseralis)
3942
* [Nathan Hunzaker](https://github.com/nhunzaker)
4043
* [Nicolas Gallagher](https://github.com/necolas)
@@ -45,7 +48,7 @@ We'd like to recognize a few people who have made significant contributions to R
4548
* [Robert Zhang](https://github.com/robertzhidealx)
4649
* [Sander Spies](https://github.com/sanderspies)
4750
* [Sasha Aickin](https://github.com/aickin)
48-
* [Seth Webster](https://github.com/sethwebster)
51+
* [Sean Keegan](https://github.com/seanryankeegan)
4952
* [Sophia Shoemaker](https://github.com/mrscobbler)
5053
* [Sunil Pai](https://github.com/threepointone)
5154
* [Tim Yung](https://github.com/yungsters)

Diff for: src/content/community/team.md

-16
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ Current members of the React team are listed in alphabetical order below.
2626
Dan got into programming after he accidentally discovered Visual Basic inside Microsoft PowerPoint. He has found his true calling in turning [Sebastian](#sebastian-markbåge)'s tweets into long-form blog posts. Dan occasionally wins at Fortnite by hiding in a bush until the game ends.
2727
</TeamMember>
2828

29-
<TeamMember name="Dave McCabe" permalink="dave-mccabe" photo="/images/team/dave-mccabe.jpg" github="davidmccabe" twitter="mcc_abe" title="Engineer at Meta">
30-
An engineer by trade and outdoorsman at heart, David has long been an innovator in the field of programming-while-sunbathing. Besides surprising his colleagues with unique outdoor video-call backgrounds, he enjoys playing guitar (in sunlit meadows, of course) and martial arts (still indoors, gotta work on that).
31-
</TeamMember>
32-
3329
<TeamMember name="Eli White" permalink="eli-white" photo="/images/team/eli-white.jpg" github="TheSavior" twitter="Eli_White" title="Engineering Manager at Meta">
3430
Eli got into programming after he got suspended from middle school for hacking. He has been working on React and React Native since 2017. He enjoys eating treats, especially ice cream and apple pie. You can find Eli trying quirky activities like parkour, indoor skydiving, and aerial silks.
3531
</TeamMember>
@@ -54,10 +50,6 @@ Current members of the React team are listed in alphabetical order below.
5450
Lauren’s programming career peaked when she first discovered the `<marquee>` tag. She’s been chasing that high ever since. When she’s not adding bugs into React, she enjoys dropping cheeky memes in chat, and playing all too many video games with her partner, and her dog Zelda.
5551
</TeamMember>
5652

57-
<TeamMember name="Luna Ruan" permalink="luna-ruan" photo="/images/team/lunaruan.jpg" github="lunaruan" twitter="lunaruan" title="Independent Engineer">
58-
Luna learned programming because she thought it meant creating video games. Instead, she ended up working on the Pinterest web app, and now on React itself. Luna doesn't want to make video games anymore, but she plans to do creative writing if she ever gets bored.
59-
</TeamMember>
60-
6153
<TeamMember name="Luna Wei" permalink="luna-wei" photo="/images/team/luna-wei.jpg" github="lunaleaps" twitter="lunaleaps" title="Engineer at Meta">
6254
Luna first learnt the fundamentals of python at the age of 6 from her father. Since then, she has been unstoppable. Luna aspires to be a gen z, and the road to success is paved with environmental advocacy, urban gardening and lots of quality time with her Voo-Doo’d (as pictured).
6355
</TeamMember>
@@ -66,10 +58,6 @@ Current members of the React team are listed in alphabetical order below.
6658
Matt stumbled into coding, and since then, has become enamored with creating things in communities that can’t be created alone. Prior to React, he worked on YouTube, the Google Assistant, Fuchsia, and Google Cloud AI and Evernote. When he's not trying to make better developer tools he enjoys the mountains, jazz, and spending time with his family.
6759
</TeamMember>
6860

69-
<TeamMember name="Mengdi Chen" permalink="mengdi-chen" photo="/images/team/mengdi-chen.jpg" github="mondaychen" twitter="mengdi_en" title="Engineer at Meta">
70-
While working on his Digital Arts degree Mengdi was conceited about his front-end skills because his CSS worked perfectly even on IE6. But soon React opened a new door of programming for him, and he has been dreaming of joining the React team ever since. Outside of work, he is usually busy chasing his two kids around or collecting strange recipes.
71-
</TeamMember>
72-
7361
<TeamMember name="Mofei Zhang" permalink="mofei-zhang" photo="/images/team/mofei-zhang.png" github="mofeiZ" title="Engineer at Meta">
7462
Mofei started programming when she realized it can help her cheat in video games. She focused on operating systems in undergrad / grad school, but now finds herself happily tinkering on React. Outside of work, she enjoys debugging bouldering problems and planning her next backpacking trip(s).
7563
</TeamMember>
@@ -86,10 +74,6 @@ Current members of the React team are listed in alphabetical order below.
8674
Sathya hated the Dragon Book in school but somehow ended up working on compilers all his career. When he's not compiling React components, he's either drinking coffee or eating yet another Dosa.
8775
</TeamMember>
8876

89-
<TeamMember name="Sean Keegan" permalink="sean-keegan" photo="/images/team/sean-keegan.jpg" github="seanryankeegan" twitter="DevRelSean" title="Developer Advocate at Meta">
90-
After a first career as a math teacher, Sean remembered that one intro to comp sci class he had to take as a prereq and thought “that was kind of fun!”. One coding bootcamp and several tech jobs later, Sean discovered developer advocacy and hasn’t looked back. Outside of work, Sean enjoys ultimate frisbee, video games, and researching (but rarely implementing) better ways to care for his houseplants.
91-
</TeamMember>
92-
9377
<TeamMember name="Sebastian Markbåge" permalink="sebastian-markbåge" photo="/images/team/sebmarkbage.jpg" github="sebmarkbage" twitter="sebmarkbage" title="Engineer at Vercel">
9478
Sebastian majored in psychology. He's usually quiet. Even when he says something, it often doesn't make sense to the rest of us until a few months later. The correct way to pronounce his surname is "mark-boa-geh" but he settled for "mark-beige" out of pragmatism -- and that's how he approaches React.
9579
</TeamMember>

Diff for: src/content/learn/passing-props-to-a-component.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ export default function Gallery() {
462462
</li>
463463
<li>
464464
<b>Discovered: </b>
465-
polonium (element)
465+
polonium (chemical element)
466466
</li>
467467
</ul>
468468
</section>

Diff for: src/content/learn/removing-effect-dependencies.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ function ChatRoom() {
926926

927927
useEffect(() => {
928928
const options = createOptions();
929-
const connection = createConnection();
929+
const connection = createConnection(options);
930930
connection.connect();
931931
return () => connection.disconnect();
932932
}, []); // ✅ All dependencies declared
@@ -1613,7 +1613,7 @@ label, button { display: block; margin-bottom: 5px; }
16131613
16141614
Your Effect is re-running because it depends on the `options` object. Objects can be re-created unintentionally, you should try to avoid them as dependencies of your Effects whenever possible.
16151615
1616-
The least invasive fix is to read `roomId` and `serverUrl` right outside the Effect, and then make the Effect depend on those primitive values (which can't change unintentionally). Inside the Effect, create an object and it pass to `createConnection`:
1616+
The least invasive fix is to read `roomId` and `serverUrl` right outside the Effect, and then make the Effect depend on those primitive values (which can't change unintentionally). Inside the Effect, create an object and pass it to `createConnection`:
16171617
16181618
<Sandpack>
16191619

Diff for: src/content/learn/state-a-components-memory.md

-2
Original file line numberDiff line numberDiff line change
@@ -1480,8 +1480,6 @@ export default function FeedbackForm() {
14801480
<Sandpack>
14811481

14821482
```js
1483-
import { useState } from 'react';
1484-
14851483
export default function FeedbackForm() {
14861484
function handleClick() {
14871485
const name = prompt('What is your name?');

Diff for: src/content/learn/state-as-a-snapshot.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ When React re-renders a component:
7979

8080
1. React calls your function again.
8181
2. Your function returns a new JSX snapshot.
82-
3. React then updates the screen to match the snapshot you've returned.
82+
3. React then updates the screen to match the snapshot your function returned.
8383

8484
<IllustrationBlock sequential>
8585
<Illustration caption="React executing the function" src="/images/docs/illustrations/i_render1.png" />

Diff for: src/content/learn/synchronizing-with-effects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ Buying is not caused by rendering; it's caused by a specific interaction. It sho
767767
}
768768
```
769769
770-
**This illustrates that if remounting breaks the logic of your application, this usually uncovers existing bugs.** From the user's perspective, visiting a page shouldn't be different from visiting it, clicking a link, and pressing Back. React verifies that your components abide by this principle by remounting them once in development.
770+
**This illustrates that if remounting breaks the logic of your application, this usually uncovers existing bugs.** From a user's perspective, visiting a page shouldn't be different from visiting it, clicking a link, then pressing Back to view the page again. React verifies that your components abide by this principle by remounting them once in development.
771771
772772
## Putting it all together {/*putting-it-all-together*/}
773773

Diff for: src/content/reference/react-dom/components/common.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ These standard DOM props are also supported for all built-in components:
100100
* `onFocusCapture`: A version of `onFocus` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
101101
* [`onGotPointerCapture`](https://developer.mozilla.org/en-US/docs/Web/API/Element/gotpointercapture_event): A [`PointerEvent` handler](#pointerevent-handler) function. Fires when an element programmatically captures a pointer.
102102
* `onGotPointerCaptureCapture`: A version of `onGotPointerCapture` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
103-
* [`onKeyDown`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event): A [`KeyboardEvent` handler](#pointerevent-handler) function. Fires when a key is pressed.
103+
* [`onKeyDown`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keydown_event): A [`KeyboardEvent` handler](#keyboardevent-handler) function. Fires when a key is pressed.
104104
* `onKeyDownCapture`: A version of `onKeyDown` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
105-
* [`onKeyPress`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event): A [`KeyboardEvent` handler](#pointerevent-handler) function. Deprecated. Use `onKeyDown` or `onBeforeInput` instead.
105+
* [`onKeyPress`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keypress_event): A [`KeyboardEvent` handler](#keyboardevent-handler) function. Deprecated. Use `onKeyDown` or `onBeforeInput` instead.
106106
* `onKeyPressCapture`: A version of `onKeyPress` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
107-
* [`onKeyUp`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event): A [`KeyboardEvent` handler](#pointerevent-handler) function. Fires when a key is released.
107+
* [`onKeyUp`](https://developer.mozilla.org/en-US/docs/Web/API/Element/keyup_event): A [`KeyboardEvent` handler](#keyboardevent-handler) function. Fires when a key is released.
108108
* `onKeyUpCapture`: A version of `onKeyUp` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)
109109
* [`onLostPointerCapture`](https://developer.mozilla.org/en-US/docs/Web/API/Element/lostpointercapture_event): A [`PointerEvent` handler](#pointerevent-handler) function. Fires when an element stops capturing a pointer.
110110
* `onLostPointerCaptureCapture`: A version of `onLostPointerCapture` that fires in the [capture phase.](/learn/responding-to-events#capture-phase-events)

Diff for: src/content/reference/react/cache.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ canary: true
44
---
55

66
<Canary>
7-
* `cache` is only for use with [React Server Components](https://react.dev/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components). See [frameworks](https://react.dev/learn/start-a-new-react-project#bleeding-edge-react-frameworks) that support React Server Components.
7+
* `cache` is only for use with [React Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components). See [frameworks](/learn/start-a-new-react-project#bleeding-edge-react-frameworks) that support React Server Components.
88

9-
* `cache` is only available in React’s [Canary](https://react.dev/community/versioning-policy#canary-channel) and [experimental](https://react.dev/community/versioning-policy#experimental-channel) channels. Please ensure you understand the limitations before using `cache` in production. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
9+
* `cache` is only available in React’s [Canary](/community/versioning-policy#canary-channel) and [experimental](/community/versioning-policy#experimental-channel) channels. Please ensure you understand the limitations before using `cache` in production. Learn more about [React's release channels here](/community/versioning-policy#all-release-channels).
1010
</Canary>
1111

1212
<Intro>
@@ -68,7 +68,7 @@ The optimization of caching return values based on inputs is known as [_memoizat
6868
- React will invalidate the cache for all memoized functions for each server request.
6969
- Each call to `cache` creates a new function. This means that calling `cache` with the same function multiple times will return different memoized functions that do not share the same cache.
7070
- `cachedFn` will also cache errors. If `fn` throws an error for certain arguments, it will be cached, and the same error is re-thrown when `cachedFn` is called with those same arguments.
71-
- `cache` is for use in [Server Components](https://react.dev/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components) only.
71+
- `cache` is for use in [Server Components](/blog/2023/03/22/react-labs-what-we-have-been-working-on-march-2023#react-server-components) only.
7272

7373
---
7474

Diff for: src/content/reference/react/useEffect.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function ChatRoom({ roomId }) {
6262
6363
* If some of your dependencies are objects or functions defined inside the component, there is a risk that they will **cause the Effect to re-run more often than needed.** To fix this, remove unnecessary [object](#removing-unnecessary-object-dependencies) and [function](#removing-unnecessary-function-dependencies) dependencies. You can also [extract state updates](#updating-state-based-on-previous-state-from-an-effect) and [non-reactive logic](#reading-the-latest-props-and-state-from-an-effect) outside of your Effect.
6464
65-
* If your Effect wasn't caused by an interaction (like a click), React will let the browser **paint the updated screen first before running your Effect.** If your Effect is doing something visual (for example, positioning a tooltip), and the delay is noticeable (for example, it flickers), replace `useEffect` with [`useLayoutEffect`.](/reference/react/useLayoutEffect)
65+
* If your Effect wasn't caused by an interaction (like a click), React will generally let the browser **paint the updated screen first before running your Effect.** If your Effect is doing something visual (for example, positioning a tooltip), and the delay is noticeable (for example, it flickers), replace `useEffect` with [`useLayoutEffect`.](/reference/react/useLayoutEffect)
6666
6767
* Even if your Effect was caused by an interaction (like a click), **the browser may repaint the screen before processing the state updates inside your Effect.** Usually, that's what you want. However, if you must block the browser from repainting the screen, you need to replace `useEffect` with [`useLayoutEffect`.](/reference/react/useLayoutEffect)
6868

0 commit comments

Comments
 (0)