# Migrate from react-native-qrcode-svg

> Switch from react-native-qrcode-svg to Patine UI's QRCode: no react-native-svg or qrcode dependency, the same size, colours, error-correction levels, quiet zone and centre logo, and the encoded matrix for your own drawing.

# Migrate from `react-native-qrcode-svg`

```diff
- 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-svg | Patine UI |
| --- | --- |
| `value` | `value` (UTF-8) |
| `size` | `size`, quiet zone included |
| `color` / `backgroundColor` | `color` / `backgroundColor` |
| `ecl` | `errorCorrection` (`'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` / `logoBorderRadius` | the plate takes `backgroundColor` and the design's corner radius |
| `enableLinearGradient` / `linearGradient` | — |
| `getRef` → `toDataURL` | `createQRCode(value)` for the matrix, to draw an SVG or PDF yourself |
| `onError` | `onError` |

[`QRCode`](../../components/qr-code) draws with plain views, so it needs neither `react-native-svg` nor the `qrcode` package.

See [all migration guides](./index.mdx) for other libraries, and [Comparison](../comparison.mdx) for when another library is the better choice.
