How to get dimensions of image with React?

Posted by Jennifer | Updated on

Want to get dimensions of image with React? You can achieve your goal just by js: through offsetHeight, offsetWidth. In order to get the img’s dimensions, img must be visible. You can’t get dimensions from a cached img.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers