BeritaAcara_A.js 954 B

12345678910111213141516171819202122232425262728293031
  1. import React, { useRef, Component } from 'react';
  2. import { useReactToPrint } from "react-to-print";
  3. import { Row, Col, Button } from "reactstrap";
  4. import Head from 'next/head'
  5. import SignatureCanvas from 'react-signature-canvas'
  6. import ComponentToPrint from "./SuratBA";
  7. import ReactToPrint, { PrintContextConsumer } from 'react-to-print';
  8. class BeritaAcara extends Component {
  9. render() {
  10. return (
  11. <div>
  12. <h1>kekekekekekek</h1>
  13. <ReactToPrint content={() => this.componentRef}>
  14. <PrintContextConsumer>
  15. {({ handlePrint }) => (
  16. <button onClick={handlePrint}>Print this out!</button>
  17. )}
  18. </PrintContextConsumer>
  19. </ReactToPrint>
  20. <ComponentToPrint ref={el => (this.componentRef = el)} />
  21. </div >
  22. );
  23. }
  24. }
  25. export default BeritaAcara