Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views2 pages

R 8

The document introduces the usePDF hook from React-pdf, which allows for enhanced control over PDF document rendering in React applications. It provides an API to access PDF creation capabilities, including an update function to trigger re-renders of the document. Key parameters include the document's root element and loading/error states for the rendered PDF.

Uploaded by

tazvitya Mapfumo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

R 8

The document introduces the usePDF hook from React-pdf, which allows for enhanced control over PDF document rendering in React applications. It provides an API to access PDF creation capabilities, including an update function to trigger re-renders of the document. Key parameters include the document's root element and loading/error states for the rendered PDF.

Uploaded by

tazvitya Mapfumo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 2
sar24i24, 7:02 PM Reactpdt = © React-pdf Edit Hooks usePDF web only React-pdf now ships a hook called useppF that enables accessing all PDF creation capabilities via a React hook API. This is great if you need more control over how the document gets rendered or how often it's updated. Usage const [instance, update] = usePDF({ document })3 Parameters Prop name Description Default document Document's root element undefined Instance object Proy 2 Description Default name Rendered document blog url. Null if loading or url o o undefined errored sob Rendered document blob instance. Nullifloadingor errored loading Loading state. It's true if current render is in place false ‘ntpsiteact-paorgthooks we 2124/24, 7:02 PM Reactpat Pro e Description name error Error message if rendering failed Update function Default undefined Used to trigger a document re-render. By default, changing the document instance does not triggers a new PDF file creation. This is especially helpful when rendering a download button or something similar, where you might want to render the document right before the action gets triggered. The update function takes the new document and does not return anything. refer to the Using the usePDF hook section € SVG Images Intpsiteact-pa-orgthooks For more information about how this hook is used please Styling > 22

You might also like