mifi / react-lottie-player

Fully declarative React Lottie player
MIT License
508 stars 53 forks source link

Animation stopped when I navigate between screen #119

Open donatello-duel opened 9 months ago

donatello-duel commented 9 months ago

Hi, I'm facing something weird. I implemented animation component using react-lottie-player. It looks working well but I found something weird. When I navigate on other screen and then come back to animation screen, my animation is freeze. I am not sure why this happens. Could you help me with this? <Lottie animationData={animationData} play={play} onLoopComplete={() => { setPlay(false); }} />

mifi commented 9 months ago

if you remove onLoopComplete={() => { setPlay(false); }}, does it work then?

donatello-duel commented 9 months ago

I mean that instead of playing to the end, it stop midway.

donatello-duel commented 9 months ago

if you remove onLoopComplete={() => { setPlay(false); }}, does it work then?

It plays to the end if I don't navigate to other screen.

mifi commented 9 months ago

maybe if you make a codesandbox or similar, then someone can help you out