Skip to content

Commit 53443b2

Browse files
authored
Merge pull request #136 from reactjs/sync-6326e7b1
2 parents 576ef54 + 6bc07e9 commit 53443b2

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

.github/workflows/discord_notify.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Discord Notify
22

33
on:
44
pull_request_target:
5-
types: [labeled]
5+
types: [opened, ready_for_review]
66

77
jobs:
88
check_maintainer:

src/content/blog/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ title: React Blog
66

77
This blog is the official source for the updates from the React team. Anything important, including release notes or deprecation notices, will be posted here first.
88

9-
You can also follow the [@react.dev](https://bsky.app/profiles/react.js) account on Bluesky, or [@reactjs](https://twitter.com/reactjs) account on Twitter, but you won’t miss anything essential if you only read this blog.
9+
You can also follow the [@react.dev](https://bsky.app/profile/react.dev) account on Bluesky, or [@reactjs](https://twitter.com/reactjs) account on Twitter, but you won’t miss anything essential if you only read this blog.
1010

1111
</Intro>
1212

src/content/learn/passing-data-deeply-with-context.md

+16-16
Original file line numberDiff line numberDiff line change
@@ -468,15 +468,15 @@ import { LevelContext } from './LevelContext.js';
468468
export default function Section({ level, children }) {
469469
return (
470470
<section className="section">
471-
<LevelContext.Provider value={level}>
471+
<LevelContext value={level}>
472472
{children}
473-
</LevelContext.Provider>
473+
</LevelContext>
474474
</section>
475475
);
476476
}
477477
```
478478

479-
This tells React: "if any component inside this `<Section>` asks for `LevelContext`, give them this `level`." The component will use the value of the nearest `<LevelContext.Provider>` in the UI tree above it.
479+
This tells React: "if any component inside this `<Section>` asks for `LevelContext`, give them this `level`." The component will use the value of the nearest `<LevelContext>` in the UI tree above it.
480480

481481
<Sandpack>
482482

@@ -514,9 +514,9 @@ import { LevelContext } from './LevelContext.js';
514514
export default function Section({ level, children }) {
515515
return (
516516
<section className="section">
517-
<LevelContext.Provider value={level}>
517+
<LevelContext value={level}>
518518
{children}
519-
</LevelContext.Provider>
519+
</LevelContext>
520520
</section>
521521
);
522522
}
@@ -567,7 +567,7 @@ export const LevelContext = createContext(1);
567567
It's the same result as the original code, but you did not need to pass the `level` prop to each `Heading` component! Instead, it "figures out" its heading level by asking the closest `Section` above:
568568

569569
1. You pass a `level` prop to the `<Section>`.
570-
2. `Section` wraps its children into `<LevelContext.Provider value={level}>`.
570+
2. `Section` wraps its children into `<LevelContext value={level}>`.
571571
3. `Heading` asks the closest value of `LevelContext` above with `useContext(LevelContext)`.
572572

573573
## Using and providing context from the same component {/*using-and-providing-context-from-the-same-component*/}
@@ -595,9 +595,9 @@ export default function Section({ children }) {
595595
const level = useContext(LevelContext);
596596
return (
597597
<section className="section">
598-
<LevelContext.Provider value={level + 1}>
598+
<LevelContext value={level + 1}>
599599
{children}
600-
</LevelContext.Provider>
600+
</LevelContext>
601601
</section>
602602
);
603603
}
@@ -643,9 +643,9 @@ export default function Section({ children }) {
643643
const level = useContext(LevelContext);
644644
return (
645645
<section className="section">
646-
<LevelContext.Provider value={level + 1}>
646+
<LevelContext value={level + 1}>
647647
{children}
648-
</LevelContext.Provider>
648+
</LevelContext>
649649
</section>
650650
);
651651
}
@@ -776,9 +776,9 @@ export default function Section({ children, isFancy }) {
776776
'section ' +
777777
(isFancy ? 'fancy' : '')
778778
}>
779-
<LevelContext.Provider value={level + 1}>
779+
<LevelContext value={level + 1}>
780780
{children}
781-
</LevelContext.Provider>
781+
</LevelContext>
782782
</section>
783783
);
784784
}
@@ -868,7 +868,7 @@ In general, if some information is needed by distant components in different par
868868
* To pass context:
869869
1. Create and export it with `export const MyContext = createContext(defaultValue)`.
870870
2. Pass it to the `useContext(MyContext)` Hook to read it in any child component, no matter how deep.
871-
3. Wrap children into `<MyContext.Provider value={...}>` to provide it from a parent.
871+
3. Wrap children into `<MyContext value={...}>` to provide it from a parent.
872872
* Context passes through any components in the middle.
873873
* Context lets you write components that "adapt to their surroundings".
874874
* Before you use context, try passing props or passing JSX as `children`.
@@ -1022,7 +1022,7 @@ li {
10221022
10231023
Remove `imageSize` prop from all the components.
10241024
1025-
Create and export `ImageSizeContext` from `Context.js`. Then wrap the List into `<ImageSizeContext.Provider value={imageSize}>` to pass the value down, and `useContext(ImageSizeContext)` to read it in the `PlaceImage`:
1025+
Create and export `ImageSizeContext` from `Context.js`. Then wrap the List into `<ImageSizeContext value={imageSize}>` to pass the value down, and `useContext(ImageSizeContext)` to read it in the `PlaceImage`:
10261026
10271027
<Sandpack>
10281028
@@ -1036,7 +1036,7 @@ export default function App() {
10361036
const [isLarge, setIsLarge] = useState(false);
10371037
const imageSize = isLarge ? 150 : 100;
10381038
return (
1039-
<ImageSizeContext.Provider
1039+
<ImageSizeContext
10401040
value={imageSize}
10411041
>
10421042
<label>
@@ -1051,7 +1051,7 @@ export default function App() {
10511051
</label>
10521052
<hr />
10531053
<List />
1054-
</ImageSizeContext.Provider>
1054+
</ImageSizeContext>
10551055
)
10561056
}
10571057

src/content/reference/react-dom/client/hydrateRoot.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ An app fully built with React will usually not have any calls to `root.unmount`.
9999
100100
This is mostly useful if your React root's DOM node (or any of its ancestors) may get removed from the DOM by some other code. For example, imagine a jQuery tab panel that removes inactive tabs from the DOM. If a tab gets removed, everything inside it (including the React roots inside) would get removed from the DOM as well. You need to tell React to "stop" managing the removed root's content by calling `root.unmount`. Otherwise, the components inside the removed root won't clean up and free up resources like subscriptions.
101101
102-
Calling `root.unmount` will unmount all the components in the root and "detach" React from the root DOM node, including removing any event handlers or state in the tree.
102+
Calling `root.unmount` will unmount all the components in the root and "detach" React from the root DOM node, including removing any event handlers or state in the tree.
103103
104104
105105
#### Parameters {/*root-unmount-parameters*/}
@@ -270,7 +270,7 @@ export default function App() {
270270
271271
</Sandpack>
272272
273-
This only works one level deep, and is intended to be an escape hatch. Don’t overuse it. Unless it’s text content, React still won’t attempt to patch it up, so it may remain inconsistent until future updates.
273+
This only works one level deep, and is intended to be an escape hatch. Don’t overuse it. React will **not** attempt to patch mismatched text content.
274274
275275
---
276276

0 commit comments

Comments
 (0)