From 9dece7dae34e6a7a0291cd0a05f8c804bfdd7b59 Mon Sep 17 00:00:00 2001 From: Haochen Wu Date: Mon, 18 Nov 2024 11:47:52 -0800 Subject: [PATCH] fix(react): react strict mode double initialization errors for thumbs (#7789) --- src/components-shared/update-swiper.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components-shared/update-swiper.mjs b/src/components-shared/update-swiper.mjs index d053ec979..d5a9439d8 100644 --- a/src/components-shared/update-swiper.mjs +++ b/src/components-shared/update-swiper.mjs @@ -26,8 +26,9 @@ function updateSwiper({ changedParams.includes('thumbs') && passedParams.thumbs && passedParams.thumbs.swiper && + !passedParams.thumbs.swiper.destroyed && currentParams.thumbs && - !currentParams.thumbs.swiper + (!currentParams.thumbs.swiper || currentParams.thumbs.swiper.destroyed) ) { needThumbsInit = true; }