vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
850 stars 335 forks source link

[RN 0.57.1] Invariant Violation: Text strings must be rendered within a <Text> component. #150

Open danivegamx opened 6 years ago

danivegamx commented 6 years ago

I'm using react-native-svg-uri in my project and I recently upgraded Xcode and RN to the latest versions 'till this issue posting. (Xcode 10, RN 0.57.1). When I want to navigate to a screen that contains this component, the app crashes with the following output:

Invariant Violation: Text strings must be rendered within a component.

screen shot 2018-09-21 at 1 27 00 pm 2

If I remove the component, it works fine.

The version that I'm using from the library is: "react-native-svg-uri": "^1.2.3", "react-native-svg": "7.0.3",

Do you think this is a library issue (since I'm using RN 0.57.1) or this might be other problem?

Thanks

fniwes commented 6 years ago

This library seem to be a little dead. Unfortunately there is bug that cause that error in some SVG with comments or texts. You can try to use any fork of this library.. several have addressed the same issue.

Also, would be usefull to have the SVG that causes that issue.

738 commented 6 years ago

+1

nicholasc commented 5 years ago

@fniwes can you link a couple of forks that have addressed the issue?

jacoblukose commented 5 years ago

I got the same issue.

MikeyFriedChicken commented 5 years ago

Same issue. Very annoying!

robertobrogi commented 5 years ago

there is another library same svg-uri?

bashbers commented 5 years ago

Can someone link a fork in which the issue is adressed?

bashbers commented 5 years ago

My current solution is to render the SVG URL inside a WebView. It's a hacky way of doing it, but it must suffice until this issue is addressed in the package.

ozsirma commented 5 years ago

Any solution ?

ozsirma commented 5 years ago

I started using react-native-svg-icon This library can be alternative for you.

enmanuel-mctekk commented 5 years ago

Same error here!

fcpineiro commented 5 years ago

Hi there,

As part of our internal development we've managed to solve this issue in our fork: addisonglobal/react-native-svg-uri

I'll be raising a PR in order to solve this. It's been caused by new React versions tagging componentWillReceiveProps as an unsafe lifecycle hook. We've just replaced that by splitting its functionality between getDerivedStateFromProps + componentDidUpdate methods.

Pull request: #160

xanderdeseyn commented 5 years ago

Same issue here.

TarikNasraoui commented 5 years ago

open the svg in the editor and delete the tags <desc> ..... that contain text and that goes work</p> <p><img src="https://user-images.githubusercontent.com/30218125/49469054-6bf87900-f7fe-11e8-99ea-d08e3c3fc10c.png" alt="capture d ecran 2018-12-04 a 20 53 10" /></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/bashbers"><img src="https://avatars.githubusercontent.com/u/23037527?v=4" />bashbers</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>This isnt a solution if you are fetching an SVG from an API. This is a workaround for local SVG files.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/zabojad"><img src="https://avatars.githubusercontent.com/u/1238030?v=4" />zabojad</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>In my case, even locally, that workaround doesn't solve the problem, I'm still having the same error...</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/nkgardose"><img src="https://avatars.githubusercontent.com/u/17337106?v=4" />nkgardose</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I experienced the same problem, i made mine work by removing all new lines of the svg file. However, it'll only work for local svg files. </p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ErickMaeda"><img src="https://avatars.githubusercontent.com/u/12499837?v=4" />ErickMaeda</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>No solutions yet? :(</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/I-O-O-I"><img src="https://avatars.githubusercontent.com/u/30801698?v=4" />I-O-O-I</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <ol> <li>Open your .svg file in text editor</li> <li>Delete all html <code>// comment</code> strings and other unnecessary text </li> <li>have fun!)</li> </ol> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/rashidul-hasan"><img src="https://avatars.githubusercontent.com/u/8081870?v=4" />rashidul-hasan</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>I'm using a local svg file that is clean. No html comments or any strange tags. But still the app crashes with this same error. Any idea? </p> <p>My svg code: </p> <pre><code class="language-xml"> <?xml version="1.0" encoding="utf-8" ?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="26"> <defs> <clipPath id="clip_0"> <rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/> </clipPath> </defs> <g clip-path="url(#clip_0)"> <path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(0.625122 0.670044)" d="M11.2463 24.955L22.5 24.955C22.5 24.955 22.5 20.765 21.9075 18.9788C21.3913 17.425 17.6625 16.385 13.75 14.91L13.75 11.785C13.75 11.785 15 11.0113 15 8.035C16.25 8.035 16.25 5.535 15 5.535C15 5.2425 16.3475 3.4375 15.9375 1.785C15.345 -0.595 8.24875 -0.595 7.65625 1.785C4.695 1.19 6.25 5.135 6.25 5.535L6.25 8.035C6.25 11.0113 8.75 11.785 8.75 11.785L8.75 14.91C5.2775 16.2288 1.1075 17.425 0.5925 18.9788C0 20.765 0 24.955 0 24.955L11.2463 24.955L11.2463 24.955Z"/> </g> <defs> <clipPath id="clip_1"> <rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/> </clipPath> </defs> <g clip-path="url(#clip_1)"> <path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(18.2813 0.796997)" d="M7.96875 24.828L11.0938 24.828C11.0938 24.828 11.0938 20.638 10.5013 18.8518C9.985 17.298 6.25625 15.633 2.34375 14.158L2.34375 12.283C2.34375 12.283 3.59375 11.5093 3.59375 8.53302C4.84375 8.53302 4.84375 6.03302 3.59375 6.03302C3.59375 5.74052 4.94125 3.70552 4.53125 2.05302C4.25375 0.940522 1.875 -0.819478 0 0.430522"/> </g> </svg>```</code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/nkgardose"><img src="https://avatars.githubusercontent.com/u/17337106?v=4" />nkgardose</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <blockquote> <p>I'm using a local svg file that is clean. No html comments or any strange tags. But still the app crashes with this same error. Any idea?</p> <p>My svg code:</p> <pre><code><?xml version="1.0" encoding="utf-8" ?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="26"> <defs> <clipPath id="clip_0"> <rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/> </clipPath> </defs> <g clip-path="url(#clip_0)"> <path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(0.625122 0.670044)" d="M11.2463 24.955L22.5 24.955C22.5 24.955 22.5 20.765 21.9075 18.9788C21.3913 17.425 17.6625 16.385 13.75 14.91L13.75 11.785C13.75 11.785 15 11.0113 15 8.035C16.25 8.035 16.25 5.535 15 5.535C15 5.2425 16.3475 3.4375 15.9375 1.785C15.345 -0.595 8.24875 -0.595 7.65625 1.785C4.695 1.19 6.25 5.135 6.25 5.535L6.25 8.035C6.25 11.0113 8.75 11.785 8.75 11.785L8.75 14.91C5.2775 16.2288 1.1075 17.425 0.5925 18.9788C0 20.765 0 24.955 0 24.955L11.2463 24.955L11.2463 24.955Z"/> </g> <defs> <clipPath id="clip_1"> <rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/> </clipPath> </defs> <g clip-path="url(#clip_1)"> <path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(18.2813 0.796997)" d="M7.96875 24.828L11.0938 24.828C11.0938 24.828 11.0938 20.638 10.5013 18.8518C9.985 17.298 6.25625 15.633 2.34375 14.158L2.34375 12.283C2.34375 12.283 3.59375 11.5093 3.59375 8.53302C4.84375 8.53302 4.84375 6.03302 3.59375 6.03302C3.59375 5.74052 4.94125 3.70552 4.53125 2.05302C4.25375 0.940522 1.875 -0.819478 0 0.430522"/> </g> </svg>```</code></pre> </blockquote> <p>My workaround for this is removing all whitespaces making it into a single-line SVG. Not sure if it'll work with your case. But try this.</p> <p><code><?xml version="1.0" encoding="utf-8" ?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="26"><defs><clipPath id="clip_0"><rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/></clipPath></defs><g clip-path="url(#clip_0)"><path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(0.625122 0.670044)" d="M11.2463 24.955L22.5 24.955C22.5 24.955 22.5 20.765 21.9075 18.9788C21.3913 17.425 17.6625 16.385 13.75 14.91L13.75 11.785C13.75 11.785 15 11.0113 15 8.035C16.25 8.035 16.25 5.535 15 5.535C15 5.2425 16.3475 3.4375 15.9375 1.785C15.345 -0.595 8.24875 -0.595 7.65625 1.785C4.695 1.19 6.25 5.135 6.25 5.535L6.25 8.035C6.25 11.0113 8.75 11.785 8.75 11.785L8.75 14.91C5.2775 16.2288 1.1075 17.425 0.5925 18.9788C0 20.765 0 24.955 0 24.955L11.2463 24.955L11.2463 24.955Z"/></g><defs><clipPath id="clip_1"><rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/></clipPath></defs><g clip-path="url(#clip_1)"><path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(18.2813 0.796997)" d="M7.96875 24.828L11.0938 24.828C11.0938 24.828 11.0938 20.638 10.5013 18.8518C9.985 17.298 6.25625 15.633 2.34375 14.158L2.34375 12.283C2.34375 12.283 3.59375 11.5093 3.59375 8.53302C4.84375 8.53302 4.84375 6.03302 3.59375 6.03302C3.59375 5.74052 4.94125 3.70552 4.53125 2.05302C4.25375 0.940522 1.875 -0.819478 0 0.430522"/></g></svg></code></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/rashidul-hasan"><img src="https://avatars.githubusercontent.com/u/8081870?v=4" />rashidul-hasan</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <blockquote> <blockquote> <p>I'm using a local svg file that is clean. No html comments or any strange tags. But still the app crashes with this same error. Any idea? My svg code:</p> <pre><code><?xml version="1.0" encoding="utf-8" ?> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="26"> <defs> <clipPath id="clip_0"> <rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/> </clipPath> </defs> <g clip-path="url(#clip_0)"> <path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(0.625122 0.670044)" d="M11.2463 24.955L22.5 24.955C22.5 24.955 22.5 20.765 21.9075 18.9788C21.3913 17.425 17.6625 16.385 13.75 14.91L13.75 11.785C13.75 11.785 15 11.0113 15 8.035C16.25 8.035 16.25 5.535 15 5.535C15 5.2425 16.3475 3.4375 15.9375 1.785C15.345 -0.595 8.24875 -0.595 7.65625 1.785C4.695 1.19 6.25 5.135 6.25 5.535L6.25 8.035C6.25 11.0113 8.75 11.785 8.75 11.785L8.75 14.91C5.2775 16.2288 1.1075 17.425 0.5925 18.9788C0 20.765 0 24.955 0 24.955L11.2463 24.955L11.2463 24.955Z"/> </g> <defs> <clipPath id="clip_1"> <rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/> </clipPath> </defs> <g clip-path="url(#clip_1)"> <path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(18.2813 0.796997)" d="M7.96875 24.828L11.0938 24.828C11.0938 24.828 11.0938 20.638 10.5013 18.8518C9.985 17.298 6.25625 15.633 2.34375 14.158L2.34375 12.283C2.34375 12.283 3.59375 11.5093 3.59375 8.53302C4.84375 8.53302 4.84375 6.03302 3.59375 6.03302C3.59375 5.74052 4.94125 3.70552 4.53125 2.05302C4.25375 0.940522 1.875 -0.819478 0 0.430522"/> </g> </svg>```</code></pre> </blockquote> <p>My workaround for this is removing all whitespaces making it into a single-line SVG. Not sure if it'll work with your case. But try this.</p> <p><code><?xml version="1.0" encoding="utf-8" ?><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="30" height="26"><defs><clipPath id="clip_0"><rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/></clipPath></defs><g clip-path="url(#clip_0)"><path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(0.625122 0.670044)" d="M11.2463 24.955L22.5 24.955C22.5 24.955 22.5 20.765 21.9075 18.9788C21.3913 17.425 17.6625 16.385 13.75 14.91L13.75 11.785C13.75 11.785 15 11.0113 15 8.035C16.25 8.035 16.25 5.535 15 5.535C15 5.2425 16.3475 3.4375 15.9375 1.785C15.345 -0.595 8.24875 -0.595 7.65625 1.785C4.695 1.19 6.25 5.135 6.25 5.535L6.25 8.035C6.25 11.0113 8.75 11.785 8.75 11.785L8.75 14.91C5.2775 16.2288 1.1075 17.425 0.5925 18.9788C0 20.765 0 24.955 0 24.955L11.2463 24.955L11.2463 24.955Z"/></g><defs><clipPath id="clip_1"><rect x="-22" y="-697" width="375" height="812" clip-rule="evenodd"/></clipPath></defs><g clip-path="url(#clip_1)"><path fill="none" stroke="rgb(126,211,33)" stroke-width="1.5" stroke-miterlimit="4" transform="translate(18.2813 0.796997)" d="M7.96875 24.828L11.0938 24.828C11.0938 24.828 11.0938 20.638 10.5013 18.8518C9.985 17.298 6.25625 15.633 2.34375 14.158L2.34375 12.283C2.34375 12.283 3.59375 11.5093 3.59375 8.53302C4.84375 8.53302 4.84375 6.03302 3.59375 6.03302C3.59375 5.74052 4.94125 3.70552 4.53125 2.05302C4.25375 0.940522 1.875 -0.819478 0 0.430522"/></g></svg></code></p> </blockquote> <p>Looks like your solution working for me too! Thanks! Also I tried removing the <code><defs></code> tags (without removing whitespaces like you did) & it worked too.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/satoshidave"><img src="https://avatars.githubusercontent.com/u/28534886?v=4" />satoshidave</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>@nkgardose It works for me! Thanks</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ShaMan123"><img src="https://avatars.githubusercontent.com/u/34343793?v=4" />ShaMan123</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>+1 @fcpineiro I tried your fork. It did manage not to crash but nothing seems to render. It does display a warning like you mentioned some where about deprecated lifecycles. <a href="https://firebasestorage.googleapis.com/v0/b/autodidact-mvp.appspot.com/o/test%2F-LAsMZHiyhcq8DvIgI2Q.svg?alt=media&token=c873a032-7bfc-4101-92c9-3388e44e7977">link to svg</a></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/xwg2015"><img src="https://avatars.githubusercontent.com/u/19931311?v=4" />xwg2015</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>same problem</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/ShaMan123"><img src="https://avatars.githubusercontent.com/u/34343793?v=4" />ShaMan123</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>check if there's a <code>title</code> property in the svg. but I think this library is dead.</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/cnomiya"><img src="https://avatars.githubusercontent.com/u/332808?v=4" />cnomiya</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>In my case, I removed <style> tag in my svg file. It worked fine!</p> <ul> <li>Before <pre><code> <!--?xml version="1.0" encoding="utf-8"?--> <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --></code></pre></li> </ul> <svg version="1.1" id="_x32_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="width: 256px; height: 256px; opacity: 1;" xml:space="preserve"> <style type="text/css"> .st0{fill:#4B4B4B;} </style> <g> <path class="st0" d="M256,0C114.625,0,0,114.625,0,256c0,141.374,114.625,256,256,256c141.374,0,256-114.626,256-256 C512,114.625,397.374,0,256,0z M351.062,258.898l-144,85.945c-1.031,0.626-2.344,0.657-3.406,0.031 c-1.031-0.594-1.687-1.702-1.687-2.937v-85.946v-85.946c0-1.218,0.656-2.343,1.687-2.938c1.062-0.609,2.375-0.578,3.406,0.031 l144,85.962c1.031,0.586,1.641,1.718,1.641,2.89C352.703,257.187,352.094,258.297,351.062,258.898z"></path> </g> </svg> <pre><code> * After</code></pre> <!--?xml version="1.0" encoding="utf-8"?--> <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> <svg version="1.1" id="_x32_" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 512 512" style="width: 256px; height: 256px; opacity: 1;" xml:space="preserve"> <g> <path class="st0" d="M256,0C114.625,0,0,114.625,0,256c0,141.374,114.625,256,256,256c141.374,0,256-114.626,256-256 C512,114.625,397.374,0,256,0z M351.062,258.898l-144,85.945c-1.031,0.626-2.344,0.657-3.406,0.031 c-1.031-0.594-1.687-1.702-1.687-2.937v-85.946v-85.946c0-1.218,0.656-2.343,1.687-2.938c1.062-0.609,2.375-0.578,3.406,0.031 l144,85.962c1.031,0.586,1.641,1.718,1.641,2.89C352.703,257.187,352.094,258.297,351.062,258.898z"></path> </g> </svg> <pre><code> * "react": "16.8.3", * "react-native": "0.59.3", * "react-native-svg": "^9.5.1", * "react-native-svg-uri": "^1.2.3",</code></pre> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/wendan52"><img src="https://avatars.githubusercontent.com/u/15261967?v=4" />wendan52</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>minify your svg file</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/musadiq-jinbade"><img src="https://avatars.githubusercontent.com/u/54430156?v=4" />musadiq-jinbade</a> commented <strong> 5 years ago</strong> </div> <div class="markdown-body"> <p>In Svg uri local image is not in current postion, can anyone know this issue? <img src="https://user-images.githubusercontent.com/54430156/65572138-b95bf780-df84-11e9-9de3-335379710960.PNG" alt="Capture" /></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/MrAlekhin"><img src="https://avatars.githubusercontent.com/u/24749983?v=4" />MrAlekhin</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <p>This solution worked for me 90% of the time:</p> <ul> <li>open your SVG in illustrator</li> <li>and export it with these properties (that minifies and removes tags safely): <img width="726" alt="Screen Shot 2019-12-05 at 2 12 10 AM" src="https://user-images.githubusercontent.com/24749983/70212387-2d451980-1705-11ea-89c9-3711474dd538.png"></li> <li>tada 🎉 <img width="274" alt="Screen Shot 2019-12-05 at 2 18 19 AM" src="https://user-images.githubusercontent.com/24749983/70212592-8c0a9300-1705-11ea-8507-e353e01fd209.png"></li> </ul> <p>Accepted tags: <code>const ACCEPTED_SVG_ELEMENTS = [ 'svg', 'g', 'circle', 'path', 'rect', 'defs', 'line', 'linearGradient', 'radialGradient', 'stop', 'ellipse', 'polygon', 'polyline', 'text', 'tspan' ];</code></p> <p><strong>Try it!!!</strong> <code><svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 80 49"><defs><clipPath id="clip-path"><rect width="80" height="49" style="fill:none"/></clipPath></defs><title>empty-box</title><g style="clip-path:url(#clip-path)"><path d="M56.44,33.47c-3.52,5-16.19,2.34-16.19,2.34l-9.81-9.07-1.32-1.23,2.22-4.65,1.91.53C39.59,23.21,59.41,29.28,56.44,33.47Z" style="fill:#efb7b9"/><path d="M33.24,21.4a20.27,20.27,0,0,1-2.8,5.34l-1.32-1.23,2.22-4.65S32.05,21.05,33.24,21.4Z" style="opacity:0.10000000149011612;isolation:isolate"/><path d="M9.82,12.1,36.94,7.74V33.1L11.17,31.77Z" style="fill:#6c63ff"/><path d="M9.82,12.1,36.94,7.74V33.1L11.17,31.77Z" style="opacity:0.05000000074505806;isolation:isolate"/><path d="M36.94,7.74l32.52,2.4-1.8,22.07-30.72.89Z" style="fill:#6c63ff"/><path d="M36.94,7.74l32.52,2.4-1.8,22.07-30.72.89Z" style="opacity:0.10000000149011612;isolation:isolate"/><path d="M46.94,0l-10,7.74,32.52,2.4,5.31-7.92ZM0,3.65,24.41.71l12.53,7L9.82,12.1ZM42.88,14.33V49l-12.7-1.29-5.53-.55L23,47l-5.52-.56-7.63-.77V12.1l27.11,1.82Zm26.58-4.19V44L59.28,45.89l-5,.94L42.88,49V14.33l26.58-4.19Z" style="fill:#6c63ff"/><path d="M69.46,10.14V44L59.28,45.89l-5,.94L42.88,49V14.33l26.58-4.19Z" style="opacity:0.05000000074505806;isolation:isolate"/><path d="M0,19.4l9.82-7.3,33.06,2.23L38,22.42Z" style="fill:#6c63ff"/><path d="M0,19.4l9.82-7.3,33.06,2.23L38,22.42Z" style="fill:#fff;opacity:0.10000000149011612;isolation:isolate"/><path d="M69.46,10.14,42.88,14.33,51.53,22,80,17.26Z" style="fill:#6c63ff"/><path d="M69.46,10.14,42.88,14.33,51.53,22,80,17.26ZM59.28,45.89l-5,.94V39.6L59,38.45l.32,7.44Z" style="fill:#fff;opacity:0.10000000149011612;isolation:isolate"/></g></svg></code></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/sdev99"><img src="https://avatars.githubusercontent.com/u/18781751?v=4" />sdev99</a> commented <strong> 3 years ago</strong> </div> <div class="markdown-body"> <p>I was also having the same problem, but I found the react-native-svg package, worked for me!</p> <p>Example:</p> <p>import { SvgUri } from 'react-native-svg';</p> <p><SvgUri width="200" height="200" uri="<a href="http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg">http://thenewcode.com/assets/images/thumbnails/homer-simpson.svg</a>" /></p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/art3wol"><img src="https://avatars.githubusercontent.com/u/55489121?v=4" />art3wol</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <blockquote> <p>This isnt a solution if you are fetching an SVG from an API. This is a workaround for local SVG files.</p> </blockquote> <p>Did anyone find a working solution for if you are fetching an SVG from an API?</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/bashbers"><img src="https://avatars.githubusercontent.com/u/23037527?v=4" />bashbers</a> commented <strong> 1 year ago</strong> </div> <div class="markdown-body"> <blockquote> <blockquote> <p>This isnt a solution if you are fetching an SVG from an API. This is a workaround for local SVG files.</p> </blockquote> <p>Did anyone find a working solution for if you are fetching an SVG from an API?</p> </blockquote> <p>I would not use a package that has not been updated for 5+ years to be honest..</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>