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

barcode-react-scanner

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

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
Source
npm
Version published
Weekly downloads
163
0.62%
Maintainers
1
Weekly downloads
 
Created
Source

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;

Keywords

react

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