JSFiddle - React, Tailwind, and code Playground
HTML
<div id="printDiv" style="position: fixed; overflow: auto; top: 0px; width: 100%; height: 100%; background: white; z-index: 9999;display: none;">
The print page content
</div>
JavaScript
$('body').css('overflow', 'hidden');
$('html').animate({ scrollTop: 0 }, 'fast', 'swing', function () {
window.print();
});