Closed s-gbz closed 2 years ago
Problem: All the react libs available only offer a single size prop in pixels. No percentages allowed.
So, to make the QR code responsive we need to update the size prop as the window changes
function handleWindowSizeChange() { const qrcodeSize = document.getElementsByClassName("window window-qrcode-generator")[0].getBoundingClientRect() } return ( <QRCode value={qrcodeValue} size={availableSpace} /> )
Problem: How can we be notified when the window's size changes?
Problem: All the react libs available only offer a single size prop in pixels. No percentages allowed.
So, to make the QR code responsive we need to update the size prop as the window changes
Problem: How can we be notified when the window's size changes?