How can I show SVG file on React Native?
See original GitHub issueI want to show svg files (i have bunch of svg images) but the thing i couldn’t find the way to show. I tried to use Image and Use components of react-native-svg but they don’t work with that. And i tried to do that with native way but it’s really hard work to show just svg image.
Example code:
import Svg, {
Use,
Image,
} from 'react-native-svg';
<View>
<Svg width="80" height="80">
<Image href={require('./svg/1f604.svg')} />
</SvgRn>
</View>
i know react native doesn’t support svg basically but i think someone fix this problem with tricky way (with/without react-native-svg)
Also i created the topic on stack overflow. http://stackoverflow.com/questions/38830568/how-can-i-show-svg-file-on-react-native
Issue Analytics
- State:
- Created 7 years ago
- Reactions:83
- Comments:30
Top Results From Across the Web
How to show SVG file on React Native? - Stack Overflow
1. Install react-native-svg · 2. Install react-native-svg-transformer · 3. Import the svg as normal component · 4. Now you can use this as...
Read more >How to use SVG in React Native | Medium
React Native SVG transformer allows you to import SVG files in your React Native project the same way that you would in a...
Read more >Working with SVGs in React Native - OpenReplay Blog
How to display and animate SVG images in React Native. ... Easily Editable: SVG files can be created and edited with any text...
Read more >react-native-svg - npm
react -native-svg provides SVG support to React Native on iOS, Android, macOS, Windows, and a compatibility layer for the web.
Read more >How to use SVGs in React Native with Expo - Level Up Coding
At the time this post is written, there are many ways to try to use SVG images in your project. The most common...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, i made this library react-native-svg-uri. You can render SVG Images from an URL or a static file.
The idea is just to break down your svg into its individual paths and then each path would be a property within the json object.
Then you can simply import the json into your app and use react-native-svg to render the svg like this: