react-to-print
Advanced tools
Changelog
2.4.0 (August 27th, 2019)
FEATURE 161: add a new callback method onPrintError
. This method is called when react-to-print
catches a Promise rejection in either onBeforeGetContent
or onBeforePrint
. The API docs were also cleaned up to better explain which method to use when.
FEATURE 158/160: add new callback method onBeforeGetContent
. Currently, onBeforePrint
is called before the print window is opened but after react-to-print
has gathered the content of the page. This new method is fired before react-to-print
gathers the content of the page, meaning it can be used to change the content of the page before printing. It can optionally return a Promise
. Thanks @andfs
Changelog
2.3.2 (August 6th, 2019)
CHORE 156: dependency upgrades. All listed dependencies were manually upgraded to their latest versions. npm audit fix
was then run to give us a clean audit. Finally, npm dedupe
was run to reduce package bloat.
FIX 156: a stylesheet that no longer exists but that was being required by the local example has been removed
NOTE: To build the library locally, Node ^8.6 is now required
Changelog
2.3.1 (August 6th, 2019)
FIX 154: TSLint was not working properly for the project. A configuration was added, and linting errors were fixed. While fixing linting errors, a bug was discovered whereby if a stylesheet was found that did not have tag type STYLE
it was possible that react-to-print
would not include all stylesheets from the page into the print window
FIX: 154 (meant to be a different PR, was included by mistake in 154): When passing removeAfterPrint
some users were getting the error TypeError: Object doesn't support property or method 'remove'
. This was due to using an incorrect way to remove the iframe
Changelog
2.3.0 (July 30th, 2019)
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 aviklaiChangelog
2.1.3 (June 22nd, 2019)