Closed yanggwangseong closed 1 year ago
lottie-react 'requestanimationframe' handler took. animation์ ๋ฌดํ์ ํธ์ถํ๋ฉด์ ๋ฐ์ํ๋ ์ค๋ฅ
import Lottie, { LottieRefCurrentProps } from 'lottie-react'; ... const lottieRef = useRef<LottieRefCurrentProps>(null); const handleLike = () => { if (lottieRef.current) { lottieRef.current.play(); if (lottieRef.current?.animationContainerRef.current) { lottieRef.current.animationContainerRef.current.style.visibility = 'visible'; } } }; useEffect(() => { if (lottieRef.current?.animationContainerRef.current) { lottieRef.current.animationContainerRef.current.style.visibility = 'hidden'; } }); const handleLottieComplete = () => { if (lottieRef.current) { lottieRef.current.stop(); if (lottieRef.current?.animationContainerRef.current) { lottieRef.current.animationContainerRef.current.style.visibility = 'hidden'; } } }; return( ... <Lottie className={styles.lottie_container} animationData={heartAnimation} loop={false} lottieRef={lottieRef} onComplete={handleLottieComplete} /> ... )
๐ก ์ด์ ์ ๋ชฉ
lottie-react 'requestanimationframe' handler took. animation์ ๋ฌดํ์ ํธ์ถํ๋ฉด์ ๋ฐ์ํ๋ ์ค๋ฅ
โจ ์ด์ ์ค๋ช
๐ฏ ์ด์ ์์ฑ ํ ํ์ธ ๋ด์ฉ