diff --git a/src/commonComponents/QRcode.tsx b/src/commonComponents/QRcode.tsx index 4d51e109..3bf1864d 100644 --- a/src/commonComponents/QRcode.tsx +++ b/src/commonComponents/QRcode.tsx @@ -4,7 +4,8 @@ import domtoimage from 'dom-to-image'; const CustomQRCode = ({ value, size }: { value: string, size: number }) => { - const inputRef = useRef(null); + const node = document.createTextNode(''); + const inputRef = useRef(node); const [isCopied, setIsCopied] = useState(false); function copyTextVal(e: React.MouseEvent) { @@ -24,7 +25,7 @@ const CustomQRCode = ({ value, size }: { value: string, size: number }) => { } const drawHtmlToCanvas = () => { - domtoimage.toJpeg(inputRef.current, { quality: 0.95 }) + domtoimage.toJpeg(inputRef.current, { quality: 0.95 }) .then(function (dataUrl) { var link = document.createElement('a'); link.download = 'my-image-name.jpeg';