Skip to content

Commit

Permalink
fix(react): react strict mode double initialization errors for thumbs (
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhaochen authored Nov 18, 2024
1 parent 1692ba4 commit 9dece7d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components-shared/update-swiper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 9dece7d

Please sign in to comment.