yarn add react-native-svg
yarn add react-native-svg-uri
npx react-native link react-native-svg
...
import * as React from 'react';
import SvgUri from 'react-native-svg-uri'; // SVG Package
import testSvg from './test.svg'; // SVG File
export default () => (
<SvgUri width="200" height="200" svgXmlData={testSvg}/>
);
I used the following solution:
Convert .svg image to JSX with https://svg2jsx.herokuapp.com/
Convert the JSX to react-native-svg component with
https://react-svgr.com/playground/?native=true
(make sure the "React Native" checkbox is checked)
implementation project(':react-native-svg')