最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - LottieFiles - DotLottieReact .lottie not loading - Stack Overflow

programmeradmin1浏览0评论

I am using LottieFiles in React v18, vite v4. In public I keep a .lottie file which I am loading with <DotLottieReact/>. Sometimes animation can't load. In console I have message: Uncaught DOMException: Index or size is negative or greater than the allowed amount.
How can I solve it?
What is the problem?

//Animation.jsx

import React from 'react';
import { DotLottieReact } from '@lottiefiles/dotlottie-react';

export const Animation = ({url="path/to/animation.lottie"}) => {
    return (
        <DotLottieReact
            src={url}
            loop
            autoplay
        />
    );
};
//SecondSection.jsx

  <div>
      <Animation url="./crown.lottie"/>
  </div>
发布评论

评论列表(0)

  1. 暂无评论