Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
useEffect(() => {
lottieAnimRef.current = lottie.loadAnimation({
container: lottieContainerRef.current,
renderer: 'svg',
loop: false,
autoplay: true,
animationData: themeIconData,
});
const duration = lottieAnimRef.current.totalFrames - 1;
lottieAnimRef.current.goToAndStop(initThemeId.current === 'dark' ? duration : 0, true);
return () => {
lottieAnimRef.current.destroy();
};
}, []);