🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

barcode-react-scanner

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

barcode-react-scanner

react component to scan barcode

1.2.0
latest
Version published
Maintainers
1
Created

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;

FAQs

Package last updated on 18 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts