vault-development / react-native-svg-uri

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

Could I use svg files in local? #101

Open kkotkkio opened 6 years ago

kkotkkio commented 6 years ago

I'm using static svg file like below.

<SvgUri width="200" height="200" source={require('../assets/images/ic_meu_tab.svg')} />

but it shows this error.

"Raw text cannot be used outside of a tag. Not rendering string: 'Generator: Sketch 47.1(45422) - http://www.bohemiancoding.comsketch'"

Crash-- commented 6 years ago

Are you on iOS or Android ?

rcacheira commented 6 years ago

@kkotkkio can you post the picture to test ?

DmitrySokolovsky commented 5 years ago

Hello. Any solution?

Gabswim commented 5 years ago

I have had this issue before and it was because the line <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch --> was not parsed well. If you removed it, that should fixed your issue.

<?xml version="1.0" encoding="UTF-8"?>
<svg width="249px" height="249px" viewBox="0 0 249 249" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 51.3 (57544) - http://www.bohemiancoding.com/sketch -->
    <title>Oval</title>
    <desc>Created with Sketch.</desc>
    <defs></defs>
    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Oval" stroke="#979797" fill="#D8D8D8" cx="124.5" cy="124.5" r="123.5"></circle>
    </g>
</svg>