You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
11
+
12
+
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.
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.
486
+
>>>>>>> 5f09d9f4467871955d794aa5fbc7bf3c4e7a5f4f
483
487
484
488
<Sandpack>
485
489
@@ -517,9 +521,9 @@ import { LevelContext } from './LevelContext.js';
517
521
exportdefaultfunctionSection({ level, children }) {
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`:
1054
+
>>>>>>> 5f09d9f4467871955d794aa5fbc7bf3c4e7a5f4f
1030
1055
1031
1056
<Sandpack>
1032
1057
@@ -1040,7 +1065,7 @@ export default function App() {
1040
1065
const [isLarge, setIsLarge] =useState(false);
1041
1066
constimageSize= isLarge ?150:100;
1042
1067
return (
1043
-
<ImageSizeContext.Provider
1068
+
<ImageSizeContext
1044
1069
value={imageSize}
1045
1070
>
1046
1071
<label>
@@ -1055,7 +1080,7 @@ export default function App() {
0 commit comments