Skip to content

Commit c2c32c4

Browse files
committed
fix(list-group): include item index on template function argument list
1 parent 85d65cd commit c2c32c4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

demo/ListGroupExamples.jsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ export function ListGroupExamples() {
2828
<h1 className="h4">Simple list group</h1>
2929
<ListGroup
3030
items={items}
31-
template={(item) => (
31+
template={(item, index) => (
3232
<>
33+
<em>{index + 1} </em>
3334
<strong>{item.title}</strong> <br />
3435
{item.description}
3536
</>

src/list-group/ListGroup.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export function ListGroup({ items, active, linked, bordered, horizontal, templat
1313
linked={linked}
1414
onSelect={onSelect}
1515
>
16-
{template(item)}
16+
{template(item, index)}
1717
</ListGroupItem>
1818
));
1919

0 commit comments

Comments
 (0)