JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://unpkg.com/html5-qrcode@2.0.9/dist/html5-qrcode.min.js"></script>
<div id="qr-reader" style="width: 600px"></div>
JavaScript
function onScanSuccess(decodedText, decodedResult) {
alert('Okunan Barkod\n'+decodedText);
window.location=decodedText;
}
var html5QrcodeScanner = new Html5QrcodeScanner(
"qr-reader", { fps: 10, qrbox: 250 });
html5QrcodeScanner.render(onScanSuccess);