From 829a2536b5d4f4ed86cb31d9c73d4d9b3be656c3 Mon Sep 17 00:00:00 2001 From: Vladimir Kharlampidi Date: Tue, 27 Feb 2024 14:22:54 +0300 Subject: [PATCH] fix(react): make sure the key is unique in virtual mode fixes #7329 --- src/react/virtual.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/react/virtual.mjs b/src/react/virtual.mjs index a9fb87e05..fb4a22b76 100644 --- a/src/react/virtual.mjs +++ b/src/react/virtual.mjs @@ -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}`, }); }); }