Next.js Discord

Discord Forum

Lottie breaks after refresh

Unanswered
Gharial posted this in #help-forum
Open in Discord
GharialOP
Hi have problem loading lottie file.

"use client"; import React from "react"; import Lottie from "lottie-react"; import BackgroundAnimation from "../../../../public/background.json"; export default function Background() { return <Lottie animationData={BackgroundAnimation} />; }

It only works well once. Once the page is refreshed, it becomes broken and takes a lot of resources.

Also can I render it somehow as a SSR?

0 Replies