You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use the new svg as react component feature from CRA2 but svgr keeps removing the <style> tag from my image. What I want is to use the inlineStyles plugin from svgo to transform the style tag into properties of the svg tag.
As I can see in #5062 and #4799 svgo has been disabled. Is there any way I can override the default configuration ? I have tried with a .svgrrc.json, a .svgo.yml and svgr key in the package.json but nothing worked.
It seems that not removing the style tag is a v3 feature of svgr. See gregberge/svgr#191.
Current version of react-scripts is 2.4.1 so maybe just an update would do the trick ?
Activity
Timer commentedon Oct 3, 2018
Removing the
<style>sounds like a bug to me.tnargib commentedon Oct 3, 2018
Ok then, I thought it was intended. So if I understand, this is more a bug from svgr ? Maybe I should create an issue there ?
Timer commentedon Oct 3, 2018
Yes, please. Your SVG should not be altered in any way.
tnargib commentedon Oct 4, 2018
It seems that not removing the style tag is a v3 feature of svgr. See gregberge/svgr#191.
Current version of react-scripts is
2.4.1so maybe just an update would do the trick ?aericson commentedon Jan 28, 2019
#5361 seems to be on hold with a fix for this. Is there anything preventing a PR that upgrades just @svgr/webpack?
aericson commentedon Feb 11, 2019
I think #5816 closed this.
VigneshPT commentedon Feb 28, 2019
I am still seeing this issue after #5816. Style tags are ignored.
mrmckeb commentedon Jun 16, 2021
CRA now ships with a newer version of SVGR and we think this is resolved. If this is still an problem, can you raise a new issue? Thanks!