Skip to content

Commit

Permalink
fix for React strict mode double initialization errors (#7293)
Browse files Browse the repository at this point in the history
  • Loading branch information
VolkerLieber committed Feb 5, 2024
1 parent cbc3dba commit 661266c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/react/swiper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const Swiper = forwardRef(
swiperParams,
);

if (onSwiper) onSwiper(swiperRef.current);
if (onSwiper && !swiperRef.current.destroyed) onSwiper(swiperRef.current);
// eslint-disable-next-line
return () => {
if (swiperRef.current && !swiperRef.current.destroyed) {
Expand Down

0 comments on commit 661266c

Please sign in to comment.