React.js

lottie-react 라이브러리에서 typescript 사용시 lottieRef 프로퍼티 타입

Dev갱이 2023. 10. 19. 17:18
728x90
<Lottie
    animationData={heartAnimation}
    loop={false}
    lottieRef={lottieRef}
/>
const lottieRef = useRef<LottieRefCurrentProps>(null);


공식 문서에 없어서, stackoverflow에서 찾음

 

출처 - 

https://stackoverflow.com/questions/67628477/how-to-use-ref-prop-and-useref-with-lottie-files-in-typescript

728x90