import{JsxToPdf}from"jsx-to-pdf";functionApp(){return(<JsxToPdf>{({ save, jsxRef, error, errorText })=>{return(<divclassName="App"ref={jsxRef}><buttonstyle={{height: 50,margin: 20,backgroundColor: '#61dafb'}}onClick={save}>Download PDF for this Page</button></div>)}}</JsxToPdf>)}
Hook Implementation
import{useJsxToPdf}from"jsx-to-pdf";functionApp(){const{ jsxRef, convertToPdf }=useJsxToPdf()return(<divclassName="App"ref={jsxRef}><buttonstyle={{height: 50,margin: 20,backgroundColor: '#61dafb'}}onClick={save}>Download PDF for this Page</button></div>)}