I want to perform a print operation using react-to-print and I want to know which button (print or cancel) is clicked in the opened preview modal for this operation. How can I do that?
I tried using the beforeprint and afterprint methods, but they don't work for my purpose.