Ejemplo 1: agregar pdf en la aplicación react importReact,PureComponentfrom”react”importDocument,Pagefrom”react-pdf/build/entry.webpack”importthrottlefrom”lodash.throttle”importpdffrom”./pdf.pdf”classAppextendsPureComponentconstructor(props)super(props)this.state=width:nullthis.throttledSetDivSize=throttle(this.setDivSize,500)componentDidMount()this.setDivSize()window.addEventListener(“resize”,this.throttledSetDivSize)componentWillUnmount()window.removeEventListener(“resize”,this.throttledSetDivSize)setDivSize=()=>this.setState(width:this.pdfWrapper.getBoundingClientRect().width)render()return(this.pdfWrapper= ref>)classPdfComponentextendsPureComponentrender()return()exportdefaultApp Ejemplo 2: Leer Más