In my React Native app, I am fetching images from an API with unknown dimensions. How do I auto scale the height if I know my desired width?
Example:
I set t
Here's a gist for a pretty simple solution that leverages @Haitao Li's proposal to use aspectRatio:
https://gist.github.com/tpraxl/02dc4bfcfa301340d26a0bf2140cd8b9
No magic and no calculations necessary. Pure "CSS" if you know the original image's dimensions.