barcode scanner react js code example
Example: barcode scanner react js
function BarcodeScanner (props) {
const [barcodeInputValue, updateBarcodeInputValue] = useState('')
function barcodeAutoFocus() {
document.getElementById("SearchbyScanning").focus()
}
function onChangeBarcode(event) {
updateBarcodeInputValue(event.target.value)
}
function onKeyPressBarcode(event) {
if (event.keyCode === 13) {
updateBarcodeInputValue(event.target.value)
}
}
return () {
}
}