Skip to content

Commit d3588fa

Browse files
committed
Fix HighlightContext usage in List component
1 parent 9a55055 commit d3588fa

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/content/reference/react/cloneElement.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,9 @@ export default function List({ items, renderItem }) {
414414
{items.map((item, index) => {
415415
const isHighlighted = index === selectedIndex;
416416
return (
417-
<HighlightContext.Provider key={item.id} value={isHighlighted}>
417+
<HighlightContext key={item.id} value={isHighlighted}>
418418
{renderItem(item)}
419-
</HighlightContext.Provider>
419+
</HighlightContext>
420420
);
421421
})}
422422
```
@@ -472,12 +472,12 @@ export default function List({ items, renderItem }) {
472472
{items.map((item, index) => {
473473
const isHighlighted = index === selectedIndex;
474474
return (
475-
<HighlightContext.Provider
475+
<HighlightContext
476476
key={item.id}
477477
value={isHighlighted}
478478
>
479479
{renderItem(item)}
480-
</HighlightContext.Provider>
480+
</HighlightContext>
481481
);
482482
})}
483483
<hr />

0 commit comments

Comments
 (0)