An expo native module for creating and displaying QR codes using the iOS CIFilter API and the Android ZXing library.
npm install expo-native-qrcodeExpo native module for creating and displaying QR codes using the iOS CIFilter API and the Android ZXing library.
```
npm install expo-native-qrcode
After installation, you need to run npx expo prebuild or pod install because this package uses native code.
> This package does not work in Expo Go. You need to create a Dev-Client using expo eas or prebuild. Instructions Dev-Client
`js
import React from 'react';
import { View, Text } from 'react-native';
import QrCode from 'expo-native-qrcode';
export function App() {
return (
flex: 1,
justifyContent: 'center',
alignItems: 'center',
}}>
);
}
`
`js
import {generateQrCode} from 'expo-native-qrcode'
[...]
const result = await generateQrCode("Hello World", 5);
`
#### Parameters:
| Parameter | Type | Note |
| --------- | -------- | ------------------------------------------ |
| data | string | The string to encode into a QRCODE. |size
| | string | The resolution of the created QRCODE Image |
#### QrCode Props
| Prop | Type | Note |
| -------------- | ------------------------------------------------------------ | -------------------------------------------------------------------------- |
| data | string | The string to encode into a QRCODE. |size
| | number | The size (width/height) of the QRCODE |style?
| | ViewStyle | Custom Style options for the QRCODE component using React Native ViewStyle |quality?
| | number | The resolution of the created QRCODE Image - Default is 5 |renderAbove?
| | React.ReactNode` | A custom component to overlay above the QRCODE |