79388218

Date: 2025-01-26 08:35:32
Score: 1
Natty:
Report link

When I change the code as following I was success.

const printRef = useRef<HTMLDivElement>(null);    
const handlePrint = useReactToPrint({
    contentRef: printRef,
    documentTitle: `My_HeaderText_Print_${userId}`,
    onAfterPrint: () => console.log('Printing completed'),
  });
console.log(componentRef.current);

react-to-print version 3.0.4

Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): When I
  • Low reputation (1):
Posted by: Uthpalavi Dias