Skip to content

Commit d12d9f0

Browse files
Expose index
1 parent db7b4ce commit d12d9f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/ResourceList/ResourceList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export interface Props {
7474
currentlySelected: number,
7575
): string[];
7676
/** Function to render each list item */
77-
renderItem(item: any, id: string): React.ReactNode;
77+
renderItem(item: any, id: string, index: number): React.ReactNode;
7878
/** Function to customize the unique ID for each item */
7979
idForItem?(item: any, index: number): string;
8080
resolveItemId?(item: any): string;
@@ -624,7 +624,7 @@ export class ResourceList extends React.Component<CombinedProps, State> {
624624

625625
return (
626626
<li key={id} className={styles.ItemWrapper}>
627-
{renderItem(item, id)}
627+
{renderItem(item, id, index)}
628628
</li>
629629
);
630630
};

0 commit comments

Comments
 (0)