-
-
Notifications
You must be signed in to change notification settings - Fork 424
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
Appends prefix__
to className
while converting to React
#547
Comments
Hey @deadcoder0904 👋, |
Those are tailwind classes in your SVG file? You can add them to the component directly when using it instead: import ExampleSVG from 'example.svg'
// ...
<ExampleSVG className="h-24 max-w-full" /> That works fine. Is the This is an SVGO plugin, but it's normally disabled by default, add |
@polarathene Shouldn't it be |
You would think that since there's no mention of it being enabled in the SVGR documentation, while SVGO docs explicitly mention it as disabled by default.. This is what SVGR is doing internally with their SVGO plugin: svgr/packages/plugin-svgo/src/config.js Lines 7 to 15 in fbb4ee5
Which is then merged with two other possible configs from the user, so you need to keep those two plugins in mind if you want to override them: svgr/packages/plugin-svgo/src/index.js Lines 87 to 95 in fbb4ee5
Note that This base config option for The prefix feature was added to SVGO in 2017. There's a related plugin That said, if your concern is with filesize, do look at the compressed size (eg gzip), as that concern may be optimized away in practice. |
I think I resolved this one simply by removing It wasn't much of an issue tbh. Just a tiny nitpick. |
I tried converting:
It gave me:
Take a look at the
prefix__
. I don't see any option to remove it as well. Is this a bug?The text was updated successfully, but these errors were encountered: