From c55001fb72b9422334108c7752317cd7288d5110 Mon Sep 17 00:00:00 2001 From: prasadgkalamkar Date: Tue, 17 Dec 2024 14:19:36 +0530 Subject: [PATCH] Added fix for qr code download link mismatch data type Signed-off-by: prasadgkalamkar --- src/commonComponents/QRcode.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commonComponents/QRcode.tsx b/src/commonComponents/QRcode.tsx index 4d51e1099..3bf1864d4 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';