mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
495 stars 52 forks source link

add get Duration method #66

Open bricebelkadi opened 2 years ago

bricebelkadi commented 2 years ago

Hi,

I added a props called "getDuration" that will return the totalFrame of the animation onLoad of the Lottie. I used to use a custom version of your library but now, because I want to publish mine on npm, Iit would be awesome if you add this functionality to your package :D

Thanks in advance and do not hesitate to contact me if needed :)

See you, and thanks again for your library ;)

mifi commented 2 years ago

Hi and thanks for your PR!

I think a better solution might actually be to expose the lottie ref, then users can get whatever data they need from the lottie object. See #1