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.6k stars 116 forks source link

replaceAttrValues works only for last SVG #152

Open itekhi opened 3 years ago

itekhi commented 3 years ago

Noticed that replacing fill attribute in svg works only for the last SVG inside one screen/file...

Screenshot 2021-09-14 at 06 22 28 Screenshot 2021-09-14 at 06 22 35

I have 2 SVGs in one file here. And I have experienced this issue too: #97. If SVG has fill-rule="evenodd" in it, it doesn't work at all.

.svgrrc

{
  "replaceAttrValues": {
    "#000": "{props.fill}"
  }
}

SVGs(they are the same, just the first paths are different

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 88.55">
  <path d="M0,51.47a4.13,..." transform="translate(0 -5.72)" fill="#000"/>
  <path d="M69.06,54.24..." transform="translate(0 -5.72)" fill="#000"/>
  <path d="M55.72,94.2..." transform="translate(0 -5.72)" fill="#000"/>
</svg>
kristerkari commented 3 years ago

@Shaffle1 Would you be able to provide some example app with the problem that I could try out?