Gamote / lottie-react

A lightweight React library for rendering complex After Effects animations in real time using Lottie.
https://lottiereact.com
Other
786 stars 59 forks source link

Cannot read properties of undefined (reading 'length') #75

Closed Mithrandiirr closed 1 year ago

Mithrandiirr commented 2 years ago

I am trying to set lotties from a CDN, while doing so, I get an error Cannot read properties of undefined (reading 'length')` This is my code :

{missions.map((mission : any) => 
   (
<div className='bg-[#000000] flex-1'>
<Lottie animationData={mission?.manuscript?.asset.url} loop={true} />
</div>
   )}

The mission?.manuscript?.asset.url} is not undefined !

GhostyJade commented 2 years ago

Hey. If your asset.url is a string it won't work. Currently, v2 doesn't support loading data by url/string, it will be implemented in v3 as discussed in #15