Gamote / lottie-react

A lightweight React library for rendering complex After Effects animations in real time using Lottie.
https://lottiereact.com
Other
796 stars 58 forks source link

Allow playOnce for interactivity action #111

Open chadkouse opened 7 months ago

chadkouse commented 7 months ago

This mimicks the playOnce animation mode in lottie-interactivity

https://docs.lottiefiles.com/lottie-interactivity/animation-modes#animate-when-visible-and-play-once

Fixes https://github.com/Gamote/lottie-react/issues/71

I tried to write a test to cover it but I couldn't get the existing tests to work. However it seems like you could take the test for play and just run the scroll action more than once and ensure that play was only called once.