react-lottie icon indicating copy to clipboard operation
react-lottie copied to clipboard

Error with gatsby

Open erikaperugachi opened this issue 6 years ago • 2 comments

erikaperugachi avatar May 12 '18 18:05 erikaperugachi

line 93 of dist/index.js will wrap animationData into animationData.default which breaks the Lottie function SVGRenderer.prototype.configAnimation.

I fixed by adding this block of code on react-lottie/dist/index.js at line 95 and line 111. Then include gatsby=true as a prop on your Lottie component.

if(_props.gatsby){
       this.options.animationData = {...this.options.animationData.default};
     }

It would be great if this could be incorporated into the react-lottie package

leetmachine avatar Jul 28 '18 21:07 leetmachine

@leetmachine Will it break if instead of checking for a gatsby property, it simply always execute this.options.animationData = {...this.options.animationData.default}?

felippenardi avatar Jul 29 '18 18:07 felippenardi