I've created a component from the lottie-react-web package.
import React from 'react';
import Lottie from 'lottie-react-web'
import animation from '../../src/animations/anim.json'
const LottieAnim = () => (
<Lottie
options = {{
animationData: animation,
loop: false,
autoplay: true,
}}
width = "60px"
height = "60px"
/>
)
export default LottieAnim
This works and builds successfully. When the DOM loads it is generating the wrapper div with the attributes defined. However, the svg in the div does not have defined viewbox parameters, as well as undefined width and height, along with the containing vectors inside the svg.

Should be animationData: animationData.default
See: https://github.com/chenqingspring/vue-lottie/issues/20
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With