LottieFiles / lottie-react

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

Slow loading #99

Closed masudhossain closed 2 years ago

masudhossain commented 2 years ago

Overview

I've noticed that the loading speed of the animations is very slow, which i assume is because of the .json endpoint. Is it possible to download the .json and use it within our project so it loads instantly?

Consuming repo

What repo were you working in when this issue occurred? lottie-react ...

Labels

theashraf commented 2 years ago

Hi @masudhossain, the src prop accepts animationData object as well, so you can easily download your lottie animations and just pass the animationData object to the src prop of <Player />. kindly check this example https://codesandbox.io/s/lottie-static-asset-110q8q

masudhossain commented 2 years ago

Amazing, thanks @theashraf