Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"animated: false" doesn't display any SVG #726

Open
maisafraiz opened this issue Sep 5, 2024 · 3 comments
Open

"animated: false" doesn't display any SVG #726

maisafraiz opened this issue Sep 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@maisafraiz
Copy link

Describe the bug

When setting animated: false in the preview, the static image doesn't show. I've tried with the pre-set SVG and with one of my own. This happens to every image. Maybe I'm missing a step?

Steps to reproduce

  1. Change the animated var to false
  2. Open the application
  3. No images appear

Expected behavior

Being able to change the lotties animation to a static SVG.

Is this responsiveness Issue

No

Screenshots

image

Desktop

  • OS: Windows 11
  • Browser: Chrome

Smartphones

No response

Additional context

No response

@maisafraiz maisafraiz added the bug Something isn't working label Sep 5, 2024
@maisafraiz
Copy link
Author

There seems to be an issue about this already (#483) but it was closed without any explanation on how it was solved. I'm hoping that creating a new one can help whoever has this problem in the future :)

@maisafraiz
Copy link
Author

I've found a solution to the issue.

Instead of doing:

<img
  alt="alt_text"
  src={require("../../assets/image/image.svg")}
></img>

You can do:

import Image from "../../assets/images/images.svg";

<img
  alt="alt_text"
  src={Image}
></img>

Since I'm really new to .js, I will not close this issue or create a merge request until someone confirms that this is a nice enough solution :)

@SaunakNandi
Copy link

@maisafraiz I belive what you suggested is more of an industry standard. It should have been coded like that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants