react-native-barcode
Getting started
$ npm install react-native-barcode-zxing --save
Mostly automatic installation
$ react-native link react-native-barcode-zxing
Manual installation
iOS
- please update rn to 0.60.* and use autolink
Android
- please update rn to 0.60.* and use autolink
Windows
- In Visual Studio add the
RNBarcode.sln
innode_modules/react-native-barcode/windows/RNBarcode.sln
folder to their solution, reference from their app. - Open up your
MainPage.cs
app
- Add
using Barcode.RNBarcode;
to the usings at the top of the file - Add
new RNBarcodePackage()
to theList<IReactPackage>
returned by thePackages
method
Usage Encode
;;; { superprops; thisonEncodePress = thisonEncodePress; thisstate = imagesrc: "" } { const self = this; const options = 'type' : 'pdf417' // types 'code' : '12345' 'width' : 200 'height' : 200 RNBarcode } { return <View style=stylescontainer> <Button title="Encode" onPress=thisonEncodePress color="#841584"></Button> <Image style=stylesbarcode ref='barcode' source= uri: thisstateimagesrc ></Image> </View> ; } const styles = StyleSheet;
Usage BarcodeView
; { return <View> <BarcodeView text="This is a Data Matrix by TEC-IT" format="DATA_MATRIX" style= height: 200 width: 200 /> </View> }
Support Types
- qrcode
- code39
- isbn10
- code128
- upca
- upce
- ean13
- ean8
- itf
- databar
- databarexp
- isbn13
- pdf417
- codabar
- aztec