LottieFiles / lottie-react

lottie web player as a react component
https://lottiefiles.com
MIT License
720 stars 80 forks source link

react 18 and strict mode duplicates animation #92

Closed fnavarrodev closed 2 years ago

fnavarrodev commented 2 years ago

Overview

We updated to react 18 and we have strict mode enabled and we noticed that in development mode our animations appear duplicated.

Consuming repo

https://github.com/LottieFiles/lottie-react v3.4.5

samuelOsborne commented 2 years ago

@fnavarrodev Im having trouble replicating this issue, could you give more info on your set up please?

https://codesandbox.io/s/react-18-lottie-player-uegtql?file=/src/App.js

fnavarrodev commented 2 years ago

Hi, without the style attribute is happening

https://codesandbox.io/s/react-18-lottie-player-forked-slq27n

In my case in a next.js project disabling "react strict mode" fixes the issue

samuelOsborne commented 2 years ago

@fnavarrodev thanks, looking in to this

theashraf commented 2 years ago

Hi @fnavarrodev The issue has been fixed in version 3.4.7 https://codesandbox.io/s/react-18-lottie-player-forked-8n2ybt Thanks

fnavarrodev commented 2 years ago

Hi @theashraf Awesome. Thanks a lot 🚀