Skip to content

Commit 2e3d1fa

Browse files
Merge branch 'main' of https://github.com/reactjs/react.dev into sync-68a93431
2 parents 1166f14 + 68a9343 commit 2e3d1fa

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

src/content/learn/conditional-rendering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ export default function PackingList() {
626626
627627
Note that you must write `importance > 0 && ...` rather than `importance && ...` so that if the `importance` is `0`, `0` isn't rendered as the result!
628628
629-
In this solution, two separate conditions are used to insert a space between then name and the importance label. Alternatively, you could use a fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
629+
In this solution, two separate conditions are used to insert a space between the name and the importance label. Alternatively, you could use a fragment with a leading space: `importance > 0 && <> <i>...</i></>` or add a space immediately inside the `<i>`: `importance > 0 && <i> ...</i>`.
630630
631631
</Solution>
632632

src/content/reference/react-dom/createPortal.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: createPortal
1010
```js
1111
<div>
1212
<SomeComponent />
13-
{createPortal(children, domNode)}
13+
{createPortal(children, domNode, key?)}
1414
</div>
1515
```
1616
@@ -22,7 +22,7 @@ title: createPortal
2222
2323
## Reference {/*reference*/}
2424
25-
### `createPortal(children, domNode)` {/*createportal*/}
25+
### `createPortal(children, domNode, key?)` {/*createportal*/}
2626
2727
To create a portal, call `createPortal`, passing some JSX, and the DOM node where it should be rendered:
2828
@@ -50,6 +50,8 @@ A portal only changes the physical placement of the DOM node. In every other way
5050
5151
* `domNode`: Some DOM node, such as those returned by `document.getElementById()`. The node must already exist. Passing a different DOM node during an update will cause the portal content to be recreated.
5252
53+
* **optional** `key`: A unique string or number to be used as the portal's [key.](/learn/rendering-lists/#keeping-list-items-in-order-with-key)
54+
5355
#### Returns {/*returns*/}
5456
5557
`createPortal` returns a React node that can be included into JSX or returned from a React component. If React encounters it in the render output, it will place the provided `children` inside the provided `domNode`.

src/content/reference/react/Fragment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function Post() {
5454
}
5555
```
5656

57-
Fragments are useful because grouping elements with a Fragment has no effect on layout or styles, unlike if you wrapped the elements in another container like a DOM element. If you inspect this example with the browser tools, you'll see that all `<h1>` and `<p>` DOM nodes appear as siblings without wrappers around them:
57+
Fragments are useful because grouping elements with a Fragment has no effect on layout or styles, unlike if you wrapped the elements in another container like a DOM element. If you inspect this example with the browser tools, you'll see that all `<h1>` and `<article>` DOM nodes appear as siblings without wrappers around them:
5858

5959
<Sandpack>
6060

0 commit comments

Comments
 (0)