Skip to content

REACT: Trying to Capture a master DIV that contains embedded IMG or DIVs (I've tried both) #2916

Answered by inthernar
inthernar asked this question in Q&A
Discussion options

You must be logged in to vote

Solved it! For others who run into the same problem as me... you need to explicitly set the HEIGHT and WIDTH of the DIV containing the elements you want to export.

Original Code:

<div className="" style={{ position: "relative" }} ref={this.printRef}>
  {renderAttributes}
</div>

Revised Code:

<div className="" style={{ position: "relative", width: "200px", height: "215px" }} ref={this.printRef}>
    {renderAttributes}
</div>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by inthernar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant