react-native-svg-transformer icon indicating copy to clipboard operation
react-native-svg-transformer copied to clipboard

replaceAttrValues works only for last SVG

Open itekhi opened this issue 3 years ago • 1 comments

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>

itekhi avatar Sep 14 '21 04:09 itekhi

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

kristerkari avatar Sep 14 '21 05:09 kristerkari