Check out example codes for "1:1 image in css". It will help you in understanding the concepts better.

Code Example 1

// aspect ratio 1:1 
// Crop image using CSS

.image {
  object-fit: cover;

  width: 300px; 
  height: 300px;
}

Learn ReactJs, React Native from akashmittal.com