Skip to content

Commit

Permalink
fix(react): make sure the key is unique in virtual mode
Browse files Browse the repository at this point in the history
fixes #7329
  • Loading branch information
nolimits4web committed Feb 27, 2024
1 parent df5f873 commit 829a253
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/react/virtual.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function renderVirtual(swiper, slides, virtualData) {
return React.cloneElement(child, {
swiper,
style,
key: `slide-${index}`,
key: child.props.virtualIndex || child.key || `slide-${index}`,
});
});
}
Expand Down

0 comments on commit 829a253

Please sign in to comment.