1

I am using @svelte-put/preprocess-inline-svg to handle SVG's in my sveltekit app.

I have an array of strings that has all of my icon names in it.

Whenever trying to use:

<svg data-inline-src=${realIconList[3]} />

I get the error: cannot find svg source for ${realIconList[3]}

How do I get the variable's value to be read instead of its actual name?

ethanfox27
  • 890
  • 1
  • 9
  • 25
  • Remove the `$` or wrap it in backticks, so that it's a template string? https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals?retiredLocale=de – Corrl Feb 26 '23 at 19:53
  • @Corrl When I do that I get the error: Expected value for the attribute – ethanfox27 Feb 26 '23 at 19:59
  • But if you set a name directly like `` it works? – Corrl Feb 26 '23 at 20:53
  • @Corrl Yeah it works if you explicitly state the name. That's how the package works. I just want to load a list of them – ethanfox27 Feb 26 '23 at 21:42

0 Answers0