tsayen / dom-to-image

Generates an image from a DOM node using HTML5 canvas
Other
10.21k stars 1.68k forks source link

Get canvas ref from another component #449

Open udarts opened 1 year ago

udarts commented 1 year ago

If I have the download button in the header of my react page and the canvas is inside another component (in the Content component):

<div>
    <Header />
    <Content />
</div> 

How can I generate an image from the canvas that component? As the ref is not shown.