How to use the @zxing/library.BrowserDatamatrixCodeReader function in @zxing/library

To help you get started, we’ve selected a few @zxing/library examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github metasfresh / metasfresh-webui-frontend / src / components / widget / BarcodeScanner / BarcodeScanner.js View on Github external
super(props);

    const barcodeScannerType = props.barcodeScannerType
      ? props.barcodeScannerType
      : 'qrCode';

    this.state = {
      barcodeScannerType: barcodeScannerType,
    };

    if (barcodeScannerType == 'qrCode') {
      this.reader = new BrowserQRCodeReader();
    } else if (barcodeScannerType == 'barcode') {
      this.reader = new BrowserBarcodeReader();
    } else if (barcodeScannerType == 'datamatrix') {
      this.reader = new BrowserDatamatrixCodeReader();
    } else {
      throw new Error('Unknown barcodeScannerType: ' + barcodeScannerType);
    }
  }