Skip to content

Commit

Permalink
Merge pull request #153 from MatthewHerbst/version/2.3.0
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
MatthewHerbst authored Jul 30, 2019
2 parents 9e93eab + 9761392 commit b018250
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 2.3.0 (July 30th, 2019)

- FEATURE [152](https://github.com/gregnb/react-to-print/pull/152): Previously, this library used a window rather than an `iframe` to handle printing. That was changed some time ago, however, the `closeAfterPrint` prop was never removed from the documentation (though it was removed from the code). This release restores similar functionality, in a new `removeAfterPrint` prop. Passing this prop will ensure that `react-to-print` removes the `iframe` it uses to print from the DOM after printing (something that it currently does not do). NOTE: the `iframe` is removed after the call to `onAfterPrint` (if provided) has completed. We will likely make this the default functionality in version 3, but are keeping it like this for now to ensure anyone relying on the `iframe` does not face issues. Thanks [aviklai](https://github.com/aviklai)

## 2.2.1 (July 22nd, 2019)

- FIX [149](https://github.com/gregnb/react-to-print/pull/149): Print window would not open if `onBeforePrint` was not given. Thanks [aviklai](https://github.com/aviklai)
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ The component accepts the following props:
| **`trigger`** | function | A function that returns a React Component or HTML element |
| **`content`** | function | A function that returns a component reference value. The content of this reference value is then used for print |
| **`copyStyles`** | boolean | Copies all &lt;style> and &lt;link type="stylesheet" /> from <head> inside the parent window into the print window. (default: true) |
| **`onBeforePrint`** | function | A callback function that triggers before print. Either returns void or a Promise. If the function returns a Promise the content will be printed when the Promise is resolved. Users are responsible for catching the Promise rejecting. |
| **`onAfterPrint`** | function | A callback function that triggers after print |
| **`removeAfterPrint`** | boolean | Remove the print iframe after action |
| **`onBeforePrint`** | function | Optional callback function that triggers before print. Either returns void or a Promise. If the function returns a Promise the content will be printed when the Promise is resolved. Users are responsible for catching the Promise rejecting. |
| **`onAfterPrint`** | function | Optional callback function that triggers after print |
| **`removeAfterPrint`** | boolean | Remove the print iframe after action. Defaults to `false`. |
| **`pageStyle`** | string | Override default print window styling |
| **`bodyClass`** | string | Optional class to pass to the print window body |

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-to-print",
"version": "2.2.1",
"version": "2.3.0",
"description": "Print React components in the browser",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down

0 comments on commit b018250

Please sign in to comment.