title: React To Print not triggered when custom button is clicked
body: <p>I have the following code to use React To print, a library to print a component:</p>
  <pre><code>    &lt;ReactToPrint
          trigger={() =&gt; 
              &lt;SqIconButton action={(e)=&gt;e} color={&quot;success&quot;}&gt;
                  &lt;AiIcons.AiFillPrinter style={{color: 'black',fontSize:'1rem'}}/&gt;
              &lt;/SqIconButton&gt;
          }
          content={() =&gt; componentRef.current}
  /&gt;
  </code></pre>
  <p>And my custom Button SqIconButton reads as follows:</p>
  <pre><code>export default function SqIconButton({children,color=&quot;primary&quot;,fontColor=&quot;#000000&quot;,action,tip=&quot;&quot;,disableElevation=false,sxstyle={},classes}){
      return(
          &lt;Tooltip title={tip}&gt;
              &lt;Button 
              color={color} 
              variant=&quot;contained&quot; 
              onClick={action} 
              disableRipple={disableElevation}
              className={`TBButton ${classes}`}
              sx={sxstyle}
              &gt;
                  {children}
              &lt;/Button&gt;
          &lt;/Tooltip&gt;      
      )
  }
  </code></pre>
  <p>In the examples of <em>React To Print</em> code for its <em>trigger</em> nothing is referencing &quot;onclick&quot; property on buttons, examples mostly look like this: <code>&lt;button&gt;print this&lt;/button&gt;</code> and if I use this element it actually works. But my custom button does not work as is, so I think I have to pass the onclick event over my action custom property, so I'm trying with <code>action={(e)=&gt;e}</code>, but the button does nothing when I press it.</p>
  <p><strong>Documentation says about trigger:</strong>
  <em>A function that returns a React Component or Element. Note: under the hood, we inject a custom onClick prop into the returned Component/Element. As such, do not provide an onClick prop to the root node returned by trigger, as it will be overwritten</em>
  So I don't know if onclick will be overwritten how could I pass this event to a child button component.</p>