score:1

Accepted answer
const onDownloadBtn = () => {
    if(cardRef.current){
      const card = cardRef.current;
      domtoimage.toBlob(card).then((blob) => {
        saveAs(blob, "card.png");
      });
    } 
  };

Related Query

More Query from same tag