brentvatne / react-native-svgkit

Experimental SVG library for react-native based off of SVGKit. Not under active development, if you would like to take over and push this forward please get in touch @notbrent on Twitter
423 stars 38 forks source link

How to use with ".svg" file? #13

Open aleclarson opened 9 years ago

aleclarson commented 9 years ago

This is how .png files are used with React Native.

React.createElement(React.Image, { source: require("image!my-icon") })

Is there a similar way for .svg files?

Is it possible to use .svg with Images.xcassets like it's recommended for .png files?

tnguyen42 commented 9 years ago

<Svg source={{uri: 'image!my-icon'}} /> should work, but I haven't tried yet.

I've actually tried after adding a height and a width, and all I can get is an empty square with red borders. A little help would be nice :-)