Load a local svg file using react-native-svg
See original GitHub issueIs there a way to load an existing svg asset from local files? Something like this:-
<Svg fillAll="#c6ccd8" width="60" height="60" source={require('../../icons/account.svg')}/>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
How to import SVG files in React Native using react-native-svg
Let's look at how you can use the react-native-svg library to render SVGs in your app. Open up the project in your favorite...
Read more >Load a local svg file using react-native-svg #900 - GitHub
Is there a way to load an existing svg asset from local files? Something like this:-
Read more >How to show SVG file on React Native? - Stack Overflow
svg files called react-native-vector-image. It doesn't need any custom babel transforms and you can use it like you would for other bitmap based ......
Read more >React Native: How To Use SVGs - Medium
First, install the react-native-svg and react-native-svg-transformer packages to your project with the package manager of your choice: yarn add ...
Read more >Working with SVGs in React Native - OpenReplay Blog
The next step is getting an SVG file. You can download any on the internet or use this. Move the downloaded file to...
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
How about the
fill
props in this way? I’m working on this thing for now as well.It uses SVGR under the hood, and it produces components looking like this:
So, if you have elements where you haven’t defined fill or stroke, then they’ll inherit from their ancestors, and if you give a value to the SvgComponent, it’ll give it to the Svg root and thus inherit from there. There is also the color property you can use in addition to stroke and fill, and it can be referenced using the
currentColor
value: https://github.com/react-native-community/react-native-svg#svg