You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|**`bodyClass?`**|`string`| One or more class names to pass to the print window, separated by spaces |
29
-
|**`content?`**|`function`| A function that returns a component reference value. The content of this reference value is then used for print |
29
+
|**`content?`**|`function`| A function that returns a component reference value. The content of this reference value is then used for print. Alternatively, pass the content directly to the callback returned by `useReactToPrint`|
30
30
|**`copyStyles?`**|`boolean`| Copy all `<style>` and `<link type="stylesheet" />` tags from `<head>` inside the parent window into the print window. (default: `true`) |
31
31
|**`documentTitle?`**|`string`| Set the title for printing when saving as a file |
32
32
|**`fonts?`**|`{ family: string, source: string; weight?: string; style?: string; }[]`| You may optionally provide a list of fonts which will be loaded into the printing iframe. This is useful if you are using custom fonts |
@@ -47,7 +47,7 @@ If you need extra control over printing and don't want to specify `trigger` dire
47
47
48
48
### `useReactToPrint`
49
49
50
-
For functional components, use the `useReactToPrint` hook, which accepts an object with the same configuration props as `<ReactToPrint />` and returns a `handlePrint` function which when called will trigger the print action. Requires React >=16.8.0. See the examples below for usage.
50
+
For functional components, use the `useReactToPrint` hook, which accepts an object with the same configuration props as `<ReactToPrint />` and returns a `handlePrint` function which when called will trigger the print action. Requires React >=16.8.0. See the examples below for usage. Additionally, for-fine tuned control, the `handlePrint` callback can accept an optional `content` prop which will can be used instead of passing a `content` prop to the hook itself.
51
51
52
52
## Compatibility
53
53
@@ -528,4 +528,4 @@ Set the container to `overflow: visible; height: fit-content` when printing, can
528
528
529
529
## Running locally
530
530
531
-
*NOTE*: Node >=12 is required to build the library locally. We use Node ^14 for our tests.
531
+
*NOTE*: The library is tested and built locally using Node >= 20.
this.logMessages(['"react-to-print" received a `content` prop and a content param passed the callback return by `useReactToPrint. The `content` prop will be ignored.'],"warning");
0 commit comments