Socket
Book a DemoInstallSign in
Socket

react-print-tool

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-print-tool

Provides methods to open print preview for a specific component

3.0.0
latest
Source
npmnpm
Version published
Weekly downloads
86
-33.33%
Maintainers
1
Weekly downloads
 
Created
Source

react-print-tool

Provides methods to open print preview for a specific component

Installation

if you're using react version >= 16.8.0

npm install react-print-tool@latest

else

npm install react-print-tool@2.0.0

Usage

Version 3.0.0


import {
  printComponent,
  printExistingElement,
  printHtml
} from "react-print-tool";

//use your own react component
await printComponent(<TheBestReactComponent prop={data} />);

// use html in a string
await printHtml("<div>Hello world</div>");

// use selector to print an existing html element
await printExistingElement("div.elementClass #elementID");

Version 2.0.0

Import the react tool object and use one of the provided methods

Example


 import { PrintTool } from "react-print-tool"

//use your own react component
 PrintTool.printFromReactComponent(<TheBestReactComponent prop={data} /> )

 // use html in a string
 PrintTool.printFromString("<div>Hello world</div>" )

// use selector to print an existing html element
 PrintTool.printExistingElement("div.elementClass #elementID")

Keywords

PrintPreview

FAQs

Package last updated on 15 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.