“SVG in React Native” Code-Antworten

Reagieren Sie native Import -SVG -Bild

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}/>
);
GutoTrosla

SVG in React Native

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)
Badie96

Ähnliche Antworten wie “SVG in React Native”

Fragen ähnlich wie “SVG in React Native”

Weitere verwandte Antworten zu “SVG in React Native” auf JavaScript

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen