react-recipes
Version:
A React Hooks utility library containing popular customized hooks
36 lines (26 loc) • 543 B
Markdown
and Print any block of html
- `style: Object`: style to be passed to the preview
```
{
ref: Ref: Click outside of this element,
handlePrint: Function - will start the print preview process
}
```
```jsx
import { usePrint } from 'react-recipes';
const App = () => {
const { ref, handlePrint } = usePrint();
return (
<div ref={ref}>
Hello World
<button onClick={handlePrint} type="button">
Print This Block
</button>
</div>
);
};
```
Preview