N
N
Newbie Ivanovich2019-08-20 10:22:22
React Native
Newbie Ivanovich, 2019-08-20 10:22:22

How to render svg markup react-native expo?

application, I make a get request, receive a response
svg markup
, this data is SVG markup (QR code) and I can’t display it in any way.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Newbie Ivanovich, 2019-08-28
@NovichokIvanovich

to display svg code in react-native + expo you need
1 Create a file
2 Get svg code using axios
3 Write data to generated file
4 Display using package

import Qrcode from 'react-native-qrcode-svg';
<Qrcode logo={{uri: путь до созданного файла}} logoSize={0} size={200}/>

R
Roman Alexandrovich, 2019-08-20
@RomReed

If you go here https://github.com/react-native-community/react-na... and scroll a bit you will find an example

Import your .svg file inside a React component:
import Logo from "./logo.svg";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question