react-zxing-scanner
v0.3.8
Published
<h1 align="center" style="display: flex; justify-content: center">
Downloads
16
Maintainers
Readme
Performant ReactJS Scanner barcode.
Installation
yarn add react-zxing-scanner
or
npm i react-zxing-scanner
MacOS recommend
bun add react-zxing-scanner
Usage
Here is a quick example
import React from "react";
import ReactZxingScanner from "react-zxing-scanner";
import { Exception, Result } from "@zxing/library";
export const App = () => {
return (
<>
<ReactZxingScanner
onUpdate={(res: Result) => {
console.log('data', res.toString())
}}
onError={(err: Exception) => {
console.error('err', err.toString())
}}
/>
</>
);
};