mainam-react-js-qrcode-scanner
v1.0.1
Published
barcode scanner using camera
Downloads
3
Maintainers
Readme
MaiNam ReactJs Barcode Scanner
This lib provide a webcam-based barcode scanner using react-webcam and @zxing/library.
Installation
npm i mainam-react-js-barcode-scanner
Usage in React:
import React from 'react';
import BarcodeScannerComponent from "mainam-react-js-barcode-scanner";
function App() {
const [ data, setData ] = React.useState('Not Found');
return (
<>
<BarcodeScannerComponent
width={500}
height={500}
onUpdate={(err, result) => {
if (result) setData(result.text)
else setData('Not Found')
}}
/>
<p>{data}</p>
</>
)
}
export default App;