react-to-print icon indicating copy to clipboard operation
react-to-print copied to clipboard

Add dynamic colors to print function

Open ratnabh opened this issue 1 year ago • 1 comments

I tried not printing my footer and what i did was

const print = `
  @media print {
    footer {
      display: none;
    }
`;
 const handlePrint = useReactToPrint({
    content: () => componentRef.current,
    copyStyles: true,
    pageStyle: print,
  });

but what it did was it stopped printing the css colors used in my component Isn't there a way to preserve the configs and just update the print query for footer as the default configs were printing the css color unless i had to set footer to display null and change the default print function to my custom

Moreover it also stopped printing my images which were rendering in my component

ratnabh avatar Feb 26 '24 09:02 ratnabh