Skip to content

Commit 97bc617

Browse files
committed
fix: 0378c6eb-331b-4161-8cff-e64b45cab3c5
1 parent 98f1045 commit 97bc617

File tree

1 file changed

+5
-3
lines changed
  • questions/what-are-react-fragments-used-for

1 file changed

+5
-3
lines changed

questions/what-are-react-fragments-used-for/en-US.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ If you need to add keys to the elements within a fragment, you must use the full
5959

6060
```jsx
6161
return (
62-
<React.Fragment>
62+
<>
6363
{items.map((item) => (
64-
<ChildComponent key={item.id} />
64+
<React.Fragment key={item.id}>
65+
<ChildComponent />
66+
</React.Fragment>
6567
))}
66-
</React.Fragment>
68+
</>
6769
);
6870
```
6971

0 commit comments

Comments
 (0)