mifi / react-lottie-player

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

Stop at last frame after completing animation #92

Closed rohandey closed 1 year ago

rohandey commented 1 year ago

@mifi I want animation to stop at the last frame once animation completes, I am try this

last_frame = PlayerRef.current.state.instance.totalFrames PlayerRef.current.goTo(last_frame)

Doesn't seem to work, is there any alternative to this.

mifi commented 1 year ago

For this use case i think it’s better to instead use lottie-web directly. Or you might be able to achieve by setting loop=false

rohandey commented 1 year ago

Thank you for the reply loop={false} could not do the trick, will try lottie-web directly now.