We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f9ec4fa + cf78559 commit f8f12c2Copy full SHA for f8f12c2
src/components/Attachments/AttachmentCarousel/Pager/index.tsx
@@ -85,10 +85,7 @@ function AttachmentCarouselPager(
85
[activePageIndex, items],
86
);
87
88
- const extractItemKey = useCallback(
89
- (item: Attachment) => (typeof item.source === 'string' || typeof item.source === 'number' ? `source-${item.source}|${item.attachmentLink}` : `reportActionID-${item.reportActionID}`),
90
- [],
91
- );
+ const extractItemKey = useCallback((item: Attachment, index: number) => `reportActionID-${item.reportActionID}-${index}`, []);
92
93
const contextValue = useMemo(
94
() => ({
@@ -124,7 +121,7 @@ function AttachmentCarouselPager(
124
121
125
122
const carouselItems = items.map((item, index) => (
126
123
<View
127
- key={extractItemKey(item)}
+ key={extractItemKey(item, index)}
128
style={styles.flex1}
129
>
130
<CarouselItem
0 commit comments