kristerkari / react-native-svg-transformer

Import SVG files in your React Native project the same way that you would in a Web application.
MIT License
1.59k stars 115 forks source link

SVG files with fill color defined within style property does not work #205

Open ydrezende opened 2 years ago

ydrezende commented 2 years ago

The program I used to author my SVG exported the file with fill color declared inside the style property like so:

style="stroke:none;fill:#000;fill-opacity:1;stroke-opacity:1"

The replaceAttrValues does not work with this method, and manually changing this fill to be declared as a property of the SVG's path worked fine.

Besides changing all my SVGs manually, is there a better method for me to get fill color as a prop on my SVG components?

kristerkari commented 2 years ago

Hello @ydrezende!

The replaceAttrValues feature is part of SVGR, so it would probably be a good idea to open this question in https://github.com/gregberge/svgr