react-native-qrcode with fixes and other enhancements since the original is not maintained anymore.
This is a fork ofreact-native-qrcode
A react-native component to generate QRcode.
Installation
npx install-peerdeps --save react-native-qrcode-generator
(Note : If you want to use the original unmaintained package, visit this link).
Usage
'use strict'; import React Component from 'react'import QRCode from 'react-native-qrcode-generator'; import AppRegistry StyleSheet View TextInput from 'react-native'; state = text: 'http://facebook.github.io/react-native/' ; { return <View => <TextInput = = = /> <QRCode = = ='black' ='white'/> </View> ; }; const styles = StyleSheet; AppRegistry; moduleexports = HelloWorld;
Output :

Available Props
prop | type | Description |
---|---|---|
value |
string ( Default : http://facebook.github.io/react-native/ ) |
Value of the QRCode. |
size |
number ( Default : 128 ) |
Size of the qrcode / image. |
bgColor |
string ( Default : white ) |
Background Color for the qrcode / image. |
fgColor |
string ( Default : black ) |
Foreground Color for the qrcode / image. |
getImageOnLoad |
function |
Returns the base64 png image data ( string ). |
Licenses
All source code is licensed under the MIT License.