UsinguseReactToPrint error: "there is nothing to print"

Joined
Dec 27, 2024
Messages
1
Reaction score
0
This function:
const reactToPrintFn = useReactToPrint({
contentRef: () => filtersRef.current,
pageStyle: () => `
size: A4 portrait;
margin: 0.25in;
-webkit-print-color-adjust: exact;
`
}); gives this error: ['There is nothing to print']. I have this <button onClick={()=>reactToPrintFn()}>Print now</button><div ref={filtersRef} > stuff to print here</div>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,049
Members
48,769
Latest member
Clifft

Latest Threads

Top