Skip to content

Commit d4673e0

Browse files
authored
Merge branch 'main' into sync-2639f369
2 parents b073af1 + 47d78da commit d4673e0

5 files changed

Lines changed: 337 additions & 713 deletions

File tree

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"remark-gfm": "^3.0.1"
4848
},
4949
"devDependencies": {
50-
"@babel/core": "^7.12.9",
50+
"@babel/core": "^7.29.6",
5151
"@babel/plugin-transform-modules-commonjs": "^7.18.6",
5252
"@babel/preset-react": "^7.18.6",
5353
"@mdx-js/mdx": "^2.1.3",
@@ -67,7 +67,7 @@
6767
"babel-eslint": "10.x",
6868
"babel-plugin-react-compiler": "^1.0.0",
6969
"chalk": "4.1.2",
70-
"esbuild": "^0.25.0",
70+
"esbuild": "^0.28.1",
7171
"eslint": "7.x",
7272
"eslint-config-next": "12.0.3",
7373
"eslint-config-react-app": "^5.2.1",
@@ -91,7 +91,7 @@
9191
"postcss-flexbugs-fixes": "4.2.1",
9292
"postcss-preset-env": "^6.7.0",
9393
"prettier": "^2.5.1",
94-
"react-server-dom-webpack": "^19.2.4",
94+
"react-server-dom-webpack": "^19.2.5",
9595
"reading-time": "^1.2.0",
9696
"remark": "^12.0.1",
9797
"remark-external-links": "^7.0.0",

src/content/learn/tutorial-tic-tac-toe.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -337,11 +337,7 @@ import './styles.css';
337337
import App from './App';
338338
```
339339

340-
<<<<<<< HEAD
341340
Mstari wa 1-5 unaleta vipande vyote muhimu pamoja:
342-
=======
343-
Lines 1-5 bring all the necessary pieces together:
344-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
345341

346342
* React
347343
* Maktaba ya React ya kuwasiliana na kivinjari cha wavuti (React DOM)
@@ -555,11 +551,7 @@ export default function Board() {
555551
}
556552
```
557553

558-
<<<<<<< HEAD
559554
Angalia jinsi, kinyume na `div`s za kivinjari, viungo vyako `Board` na `Square` lazima vianze na herufi kubwa.
560-
=======
561-
Note how unlike the browser `div`s, your own components `Board` and `Square` must start with a capital letter.
562-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
563555

564556
Hebu tuangalie:
565557

@@ -907,33 +899,17 @@ body {
907899
908900
### React Developer Tools za {/*react-developer-tools*/}
909901
910-
<<<<<<< HEAD
911902
React DevTools hukuruhusu kuangalia *props* na *state* za vipengele vyako vya React. Unaweza kupata kichupo cha React DevTools chini ya sehemu ya *browser* katika CodeSandbox:
912903
913904
![React DevTools katika CodeSandbox](../images/tutorial/codesandbox-devtools.png)
914905
915906
Ili kuchunguza kipengele fulani kwenye skrini, tumia kitufe kilicho kwenye kona ya juu kushoto ya React DevTools:
916907
917908
![Kuchagua vipengele kwenye ukurasa na React DevTools](../images/tutorial/devtools-select.gif)
918-
=======
919-
React Developer Tools let you check the props and the state of your React components. It is available as a [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/), and [Edge](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil) browser extension.
920-
921-
After you install it, a new *Components* tab will appear in your browser Developer Tools for sites using React. If you're following along in CodeSandbox, you'd need to first open your sandbox preview in a new tab:
922-
923-
![opening in new tab](../images/tutorial/sandbox-new-tab.png)
924-
925-
Then, on the preview page, open your browser's DevTools and find the *Components* tab:
926-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
927909
928910
![components tab](../images/tutorial/components-tab.png)
929911
930-
<<<<<<< HEAD
931912
Kwa maendeleo ya ndani (local development), React DevTools inapatikana kama [Chrome](https://chrome.google.com/webstore/detail/react-developer-tools/fmkadmapgofadopljbjfkapdkoienihi?hl=en), [Firefox](https://addons.mozilla.org/en-US/firefox/addon/react-devtools/), na [Edge](https://microsoftedge.microsoft.com/addons/detail/react-developer-tools/gpphkfbcpidddadnkolkpfckpihlkkil) *browser extension*. Isakinishe, na kichupo cha *Components* kitaonekana kwenye Zana za Watengenezaji wa kivinjari chako kwa tovuti zinazotumia React.
932-
=======
933-
To inspect a particular component on the screen, use the button in the top left corner of the Components tab:
934-
935-
![inspecting with devtools](../images/tutorial/devtools-inspect.gif)
936-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
937913
938914
939915
## Kukamilisha Mchezo {/*completing-the-game*/}
@@ -1117,11 +1093,7 @@ function Square({ value, onSquareClick }) {
11171093
}
11181094
```
11191095
1120-
<<<<<<< HEAD
11211096
Sasa utaunganisha kipengele cha `onSquareClick` na function katika sehemu ya `Board` utakayoita `handleClick`. Ili kuunganisha `onSquareClick` na `handleClick`, utapita function kwa kipengele cha `onSquareClick` cha sehemu ya kwanza ya `Square`:
1122-
=======
1123-
Now you'll connect the `onSquareClick` prop to a function in the `Board` component that you'll name `handleClick`. To connect `onSquareClick` to `handleClick` you'll pass a function to the `onSquareClick` prop of the first `Square` component:
1124-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
11251097
11261098
```js
11271099
export default function Board() {
@@ -2100,22 +2072,13 @@ export default function Game() {
21002072
}
21012073
```
21022074
2103-
<<<<<<< HEAD
21042075
Unaweza kuona jinsi kanuni yako inavyopaswa kuonekana hapa chini. Kumbuka kwamba unapaswa kuona hitilafu katika koni ya zana za mende inayosema:
2105-
=======
2106-
You can see what your code should look like below. Note that you should see an error in the developer tools console that says:
2107-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
21082076
21092077
<ConsoleBlock level="warning">
21102078
Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of &#96;Game&#96;.
21112079
</ConsoleBlock>
2112-
<<<<<<< HEAD
21132080
21142081
Utarekebisha hitilafu hii katika sehemu inayofuata.
2115-
=======
2116-
2117-
You'll fix this error in the next section.
2118-
>>>>>>> 2639f369946f763fff9a2572b0d7c4b9e2f83ebd
21192082
21202083
<Sandpack>
21212084

src/content/reference/react/Fragment.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,13 @@ Wrap elements in `<Fragment>` to group them together in situations where you nee
3838

3939
* React does not [reset state](/learn/preserving-and-resetting-state) when you go from rendering `<><Child /></>` to `[<Child />]` or back, or when you go from rendering `<><Child /></>` to `<Child />` and back. This only works a single level deep: for example, going from `<><><Child /></></>` to `<Child />` resets the state. See the precise semantics [here.](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b)
4040

41-
* <CanaryBadge /> If you want to pass `ref` to a Fragment, you can't use the `<>...</>` syntax. You have to explicitly import `Fragment` from `'react'` and render `<Fragment ref={yourRef}>...</Fragment>`.
41+
**Layout methods:**
42+
- `compareDocumentPosition(otherNode)`: Compares the document position of the Fragment with another node.
43+
- If the Fragment has children, the native `compareDocumentPosition` value is returned.
44+
- Empty Fragments will attempt to compare positioning within the React tree and include `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`.
45+
- Elements that have a different relationship in the React tree and DOM tree due to portaling or other insertions are `Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`.
46+
- `getClientRects()`: Returns a flat array of `DOMRect` objects representing the bounding rectangles of all children.
47+
- `getRootNode()`: Returns the root node containing the Fragment's parent DOM node.
4248

4349
---
4450

@@ -759,12 +765,10 @@ function VisibleGroup({ onVisibilityChange, children }) {
759765
onVisibilityChange(visibleElements.size > 0);
760766
}
761767
);
762-
const fragmentInstance = fragmentRef.current;
763-
fragmentInstance.observeUsing(observer);
764-
return () => {
765-
fragmentInstance.unobserveUsing(observer);
766-
};
767-
}, [onVisibilityChange]);
768+
769+
fragmentRef.current.observeUsing(observer);
770+
return () => fragmentRef.current.unobserveUsing(observer);
771+
}, [threshold, onVisibilityChange]);
768772

769773
return (
770774
<Fragment ref={fragmentRef}>

src/content/reference/react/use.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,12 @@ function Albums({ albumsPromise }) {
13141314
</ErrorBoundary>
13151315
```
13161316
1317-
---
1317+
```jsx
1318+
function Albums({ albumsPromise }) {
1319+
// ✅ Call `use` without try-catch
1320+
const albums = use(albumsPromise);
1321+
// ...
1322+
```
13181323
13191324
### I'm getting a warning: "A component was suspended by an uncached promise" {/*uncached-promise-error*/}
13201325
@@ -1332,9 +1337,11 @@ function Albums() {
13321337
13331338
To fix this, cache the Promise so the same instance is reused:
13341339
1335-
```js
1336-
// ✅ fetchData returns the same Promise for the same URL
1337-
const albums = use(fetchData('/albums'));
1340+
```jsx
1341+
function MessageComponent({messagePromise}) {
1342+
// ✅ `use` is being called from a component.
1343+
const message = use(messagePromise);
1344+
// ...
13381345
```
13391346
13401347
See [caching Promises for Client Components](#caching-promises-for-client-components) for more details.

0 commit comments

Comments
 (0)