JSFiddle - React, Tailwind, and code Playground

HTML

<div class="container">
    <div class="image-wrapper">
        <img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Kirchspiel%2C_R%C3%B6dder%2C_M%C3%A4usescheune_--_2014_--_2944.jpg/500px-Kirchspiel%2C_R%C3%B6dder%2C_M%C3%A4usescheune_--_2014_--_2944.jpg" />
    </div>
</div>

CSS

.container { 
    width: 100vw;
    height: 100vh;
    background-color: grey;
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translateX(-50%) translateY(-50%);
}