Skip to content

Commit

Permalink
fix(react): fix virtual loop when not enough slides
Browse files Browse the repository at this point in the history
fixes #6487
  • Loading branch information
nolimits4web committed Mar 16, 2023
1 parent d0beb9f commit 57d8eea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/react/virtual.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ function renderVirtual(swiper, slides, virtualData) {
slidesToRender.push(slides[getSlideIndex(i)]);
}
}
return slidesToRender.map((child) => {
return slidesToRender.map((child, index) => {
return React.cloneElement(child, {
swiper,
style,
key: `slide-${index}`,
});
});
}
Expand Down

0 comments on commit 57d8eea

Please sign in to comment.