Skip to content

Latest commit

 

History

History

to-print

Folders and files

README.md

@octanejs/to-print

Octane binding for [email protected].

Installation

npm install @octanejs/to-print
pnpm add @octanejs/to-print
import { 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.