Skip to content

Commit

Permalink
处理swiper内存溢出
Browse files Browse the repository at this point in the history
在hook里关闭定时器,否则会导致内存溢出
  • Loading branch information
shamerKill authored Nov 13, 2020
1 parent a61225d commit f7f9759
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions components/swiper/swiper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ const InternalSwiper: React.FC<SwiperProps> = (props: SwiperProps) => {
});
};
getSwiperWidth();
return () => {
clearInterval(intervalId.current);
}
}, []);

// Seamless switching
Expand Down

0 comments on commit f7f9759

Please sign in to comment.