Closed hongz1 closed 3 weeks ago
You could use something like react-to-print
https://www.npmjs.com/package/react-to-print
in the trigger
prop you could pass a component that renders all table rows as a regular list (not using react-window).
react-to-print
has a onBeforeGetContent
prop, where you could return a Promise that completes after you have rendered the full list for printing. You could pass a callback to the printable table component that resolves the Promise once it is rendered for print.
Example: https://codesandbox.io/s/mutable-lake-l4ig36?file=/src/App.tsx (note the styles in index.css
as well, to hide the printable table contents for screen media while the print dialog is open)
I am using react-window with react-virtualized-auto-sizer and looking for advise how to make print button to print table rows. Thanks.