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

Simple Svg works on iOS but not on Android #174

Closed charity-detalytics closed 2 years ago

charity-detalytics commented 2 years ago

Bug

Simple Svg works on iOS but not on Android

Screen Shot 2022-02-19 at 16 04 44

Steps To Reproduce

I have just created this new and simple repo for reproducing the issue: https://github.com/charity-detalytics/SrgErr

import React from 'react';
import type {Node} from 'react';
import {
  View,
} from 'react-native';
import X from './x.svg'

const App: () => Node = () => {
  return (
    <View>
      <X/>
    </View>
  );
};

export default App;
<svg width="100%" height="100%" viewBox="0 0 325 432">
  <mask id="id" x="143" y="278" width="182" height="69">
    <path d="M143.867 278.211H325V346.467H143.867V278.211Z" fill="white"/>
  </mask>
  <g mask="url(#id)">
    <path d="M167.267 323.524L487.933 264.391L818.133 323.524" stroke="red" stroke-width="13"/>
  </g>
</svg>

Describe what you expected to happen: Please see the screen shot above!

kristerkari commented 2 years ago

I'm not sure why it looks different on Android and iOS, but it's the mask that is causing it not to render on Android.

kristerkari commented 2 years ago

Closing this as solved.