Auto-scaling Images in React Native

— 1 minute read

One method to auto-scale images in React Native while preserving aspect ratio:

const imageStyles = {
flex: 1,
width: null,
height: null,
resizeMode: 'contain',
}

const Example = () => {
return (
<Image
style={imageStyles}
source=
/>
);
}