Octane binding for [email protected].
npm install @octanejs/to-print
pnpm add @octanejs/to-printimport { useRef } from 'octane';
import { useReactToPrint } from '@octanejs/to-print';
export function Invoice() {
const contentRef = useRef<HTMLDivElement>(null);
const handlePrint = useReactToPrint({ contentRef });
return (
<div>
<button type="button" onClick={handlePrint}>Print</button>
<div ref={contentRef}>printable</div>
</div>
);
}
See UPSTREAM.md for the pin and crosswalk.