A modern React Component for reading USB Barcode Scanners
MIT License
A modern React Component for reading USB Barcode Scanners
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import Barcy from 'barcy';
const App = () => {
const [value, setValue] = React.useState('');
return (
<>
<Barcy onScan={(str) => setValue(str)} />
<p>Scanned value: {value}</p>
</>
);
};
ReactDOM.render(<App />, document.getElementById('root'));
todo
yarn
Install dependencies.
yarn dev
Build the component, then start the demo site
This package is a modern version of https://github.com/kybarg/react-barcode-reader