Closed JoseOrtiz closed 2 years ago
Hi, I see indeed that those attributes are stripped out.
What are you trying to accomplish with those data attributes? Perhaps it can be done in a different way. For example, you could work with ref
to access the svg.
I just wanted to test its presence, with the data-testid
approach. I know it could be bypassed, but I want to know if another solution could be possible
I also need the attributes to remain intact. Otherwise i cannot use this
I tried fixing it, and it seems that if you return an object with the render function, the attribute inheritance starts working!
Here's a PR: https://github.com/jpkleemans/vite-svg-loader/pull/32 Mind giving it a try?
Looks like related: https://github.com/jpkleemans/vite-svg-loader/issues/31
When transforming an svg to a component and trying to add an attribute, like `data-testid, and it's not being rendered
Example:
Render as: