Skip to main content

Migrate from react-native-qrcode-svg

- import QRCode from 'react-native-qrcode-svg';
+ import { QRCode } from 'patine-ui';

- <QRCode value={url} size={180} color="#111" backgroundColor="#fff" ecl="H" logo={logo} logoSize={40} quietZone={16} />
+ <QRCode value={url} size={180} color="#111" backgroundColor="#fff" errorCorrection="H" logo={<Image source={logo} style={{ width: 32, height: 32 }} />} logoSize={0.22} quietZone={2} />
react-native-qrcode-svgPatine UI
valuevalue (UTF-8)
sizesize, quiet zone included
color / backgroundColorcolor / backgroundColor
eclerrorCorrection ('M', or 'H' with a logo)
quietZone (px)quietZone (modules, default 4)
logo (image source) + logoSize (px)logo (any node) + logoSize (share of the width)
logoBackgroundColor / logoMargin / logoBorderRadiusthe plate takes backgroundColor and the design's corner radius
enableLinearGradient / linearGradient—
getRef → toDataURLcreateQRCode(value) for the matrix, to draw an SVG or PDF yourself
onErroronError

QRCode draws with plain views, so it needs neither react-native-svg nor the qrcode package.

See all migration guides for other libraries, and Comparison for when another library is the better choice.