Nutritious Pancake Mountain
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

barcode-react-scanner

1.2.0 • Public • Published

Build Status Coverage Status

barcode-react-scanner

Is a simple react component to read barcodes.

How to use ?

Install

Recommended way to install is by using package manager (npm, yarn etc):

npm i barcode-react-scanner

or

yarn add barcode-react-scanner

Use

import React, { useState } from 'react';
import BarCodeScanner from 'barcode-react-scanner';
 
const TestingComponent = (): JSX.Element => {
 
 const [code, setCode] = useState<string>('')
 
 return (
     <>
     { code && <p> code </p> }
     <BarCodeScanner onUpdate={ (err, resp): void => {
         if(resp) {
             setCode(resp.getText())
         }
      }}
    />
    </>
 );
 
}
 
export default TestingComponent;

Install

npm i barcode-react-scanner

DownloadsWeekly Downloads

19

Version

1.2.0

License

ISC

Unpacked Size

8.43 kB

Total Files

13

Last publish

Collaborators

  • avatar