Open wang1000cs opened 1 year ago
use
(lottie as any).loadAnimation
to fix it
This worked for me.
import Lottie from 'lottie-web'
import lottie from "lottie-web";
works for me. Here's a code sandbox demo: https://codesandbox.io/s/worker-removeattribute-not-a-function-qloj5j?file=/src/App.js:60-92
Tell us about your environment
What did you do? Please explain the steps you took before you encountered the problem.
import * as lottie from 'lottie-web';
const player = lottie.loadAnimation({
animationData: jsonObj,
container: lottieEl,
renderer: 'svg',
loop: true,
autoplay: true,
`});``What did you expect to happen?
i got a warning from Ts,
Property 'loadAnimation' does not exist on type 'typeof import("F:/work/seedling_ide/node_modules/lottie-web/index")'.ts(2339)
What actually happened? Please include as much relevant detail as possible.
Please provide a download link to the After Effects file that demonstrates the problem.