@phygrid/barcode-scanner-react
v0.1.18
Published
## Installation
Downloads
1
Readme
React custom hook for barcode scanner integration.
Installation
npm install @ombori/ga-barcode-scanner --save
or
yarn add @ombori/ga-barcode-scanner
Usage
import useBarcodeScanner from '@ombori/ga-barcode-scanner';
const App = () => {
const onScan = (barcode) => console.log(barcode);
useBarcodeScanner(onScan);
return <div>Hello World!</div>;
}
Helpers
There are also two helper functions that you can use to differentiate barcodes and boarding passes.
import { isBarcode, isBoardingPass } from '@ombori/ga-barcode-scanner';