Skip to content
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

Display svg image from API #171

Open
latusdenis opened this issue Feb 25, 2019 · 5 comments
Open

Display svg image from API #171

latusdenis opened this issue Feb 25, 2019 · 5 comments

Comments

@latusdenis
Copy link

Hi!
Trying to display the image, which I get from https://restcountries.eu/rest/v2/all.

<SvgUri width="30" height="30" source={{uri: 'https://restcountries.eu/data/afg.svg'}} />

But I am getting this error:
image

Using the image from example instead works perfectly. What can be the problem?

Thanks!

@geekdreamzz
Copy link

Same for me - also tried sending "string" into svgXmlData prop which the readme says, but get the same errors

@geekdreamzz
Copy link

geekdreamzz commented Mar 3, 2019

hey @latusdenis - I don't have a fix but I think I know whats happening.
In my svg when I removed the <use /> tag - it renders just fine... So it's almost like it doesn't work for svgs that have pointers to another element.

I plan to see if I can generate my svgs with a bunch of fills only. I'll also try and see if I can take a look at this lib and make a pr if I can develop a fix.

@geekdreamzz
Copy link

was able to get around this error with this: https://github.com/kristerkari/react-native-svg-transformer

@latusdenis
Copy link
Author

@geeklevel1000 Thanks for your help! May me the problem with the lib, which doesn't render some SVG's properly.
I've used https://github.com/chitezh/react-native-svg-image lib instead and it worked perfectly for me.

@durdevic
Copy link

I had issues with showing SVGs on Android on release version even though it worked on development (known issue).

This solved my issue, https://github.com/seekshiva/react-native-remote-svg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants