Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-to-print

Package Overview
Dependencies
Maintainers
2
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-to-print - npm Package Compare versions

Comparing version 2.8.0-beta.1 to 2.8.0

39

CHANGELOG.md
# CHANGELOG
## 2.8.0 (May 19th, 2020)
- FEATURE [245](https://github.com/gregnb/react-to-print/pull/245): `documentTitle` prop can now be passed to set a default filename when the user is saving as a PDF. Thanks [zb2oby](https://github.com/zb2oby)
- FEATURE [244](https://github.com/gregnb/react-to-print/pull/244): `trigger` is now an optional prop. To print without it we now offer two new options.
`PrintContextConsumer` with a render-props pattern:
```js
import { PrintContextConsumer } from 'react-to-print';
<ReactToPrint content={() => this.componentRef}>
<PrintContextConsumer>
{({ handlePrint }) => <button onClick={handlePrint}>Print this out!</button>}
</PrintContextConsumer>
</ReactToPrint>
```
`useReactToPrint` for hook-based printing
```js
import { useReactToPrint } from 'react-to-print';
const Example = () => {
const componentRef = useRef();
const handlePrint = useReactToPrint({ content: () => componentRef.current });
return (
<div>
<ComponentToPrint ref={componentRef} />
<button onClick={handlePrint}>Print this out!</button>
</div>
);
};
```
Huge thanks to [vtsybulin](https://github.com/vtsybulin) for these fantastic additions.
- CHORE: upgrade `devDependencies` to latest
## 2.7.0 (May 1st, 2020)

@@ -4,0 +43,0 @@

2

package.json
{
"name": "react-to-print",
"version": "2.8.0-beta.1",
"version": "2.8.0",
"description": "Print React components in the browser",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc