Answer the question
In order to leave comments, you need to log in
How can I find out the dimensions of a DOM-mounted image?
There is a component that draws a certain picture
renderImage() {
const {
img,
} = this.state;
return (
<img
id="bImage"
src={img}
/>
);
}
const image = document.getElementById('bImage');
???
Answer the question
In order to leave comments, you need to log in
create a function that renders the image.
const { img } = this.state;
const image = new Image();
img.src = image;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question