You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you tried dynamically importing the json file as an object with await import("./lottie.json")?
I'm using next.js and my json file is excluded from the main bundle when I dyamically import the json into a state variable within a useEffect hook. Then, I pass that value into the animationData member of the options prop in the <Lottie /> component.
I have Lottie JSON file with 500KB. If I keep it in the public folder, it will increase the bundle size.
Is there any best practice to use Lottie JSON file and not increase the bundle size?
The text was updated successfully, but these errors were encountered: