-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nested SVGs not rendering gradients #1437
Comments
As a work around I've found that I if I wrap the nested SVG in a RN <Svg>
...rest of the SVG code
<ForgienObject>
<View>
<Svg width={50} height={50}>
<Defs>
<LinearGradient id="grad2" x1={'0%'} y1={'0%'} x2={'100%'} y2={'100%'}>
<Stop offset={0} stopColor="red" />
<Stop offset={1} stopColor="blue" />
</LinearGradient>
</Defs>
<Circle cx={25} cy={25} r={25} fill={'url(#grad2)'} strokeWidth={1} stroke="black" />
</Svg>
</View>
</ForgienObject>
</Svg> |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a "discussion" and I will leave this open. |
I found a solution that instead of using the svgs having gradient,I converted the SVG into a Lottie file. that works great and as an extra advantage, we can transform the SVG into a simple animation :) |
This should be fixed by #1939. Can you check if it is so? |
PR making the nested svgs parse the references. Originally authored by @tiredBlueWhale. Co-authored-by: Luca Meyer <[email protected]>
I am drawing an image that pulls in icons defined as SVGs from config files. When the svgs are pulled in I am not seeing the gradients render in the nested SVGs.
I have experienced this on RN SVG ^9.13.0 to 12.1.0 in iOS
Minimal Example:
Output Screenshot:
Snack:
In this snack, it appears to work on Web and Android, but fails in iOS
https://snack.expo.io/eQ62NyiMSr
The text was updated successfully, but these errors were encountered: