Closed marcelluscaio closed 11 months ago
Looks like a compiler bug. If I have <Comp class=`a ${b}` />
(or any template string value), it gets compiled into:
...
return $$render`${$$renderComponent($$result,'Comp',Comp,{"class":`class`})}`;
}, '<stdin>');
...
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
I was using an a tag with multiple classes in a template string.
This worked fine. I decided to make the tag variable according to props passed to the component. It stopped working. I noticed that if I only had the string part, without the ${} notation, it would work. To make it work with the variable classes, I needed to use class:list
What's the expected result?
Being able to use template strings with variable tag, without needing class:list
Link to Minimal Reproducible Example
https://github.com/marcelluscaio/portfolioCaioCabral/blob/projectPage/src/components/Elements/Button.astro
Participation