JSFiddle - React, Tailwind, and code Playground

HTML

<div class="slideshow">
<img src="http://dummyimage.com/400x260/000/fff.png&text=Image+01" />
<img src="http://dummyimage.com/400x260/000/fff.png&text=Image+02" />
<img src="http://dummyimage.com/400x260/000/fff.png&text=Image+03" />

</div>

CSS

.slideshow {
   overflow: hidden;
    width: 400px;
    height: 260px;
    background-color: #000;
    margin: 10px;
}

JavaScript

var count = 1;
setInterval(function() {
    count = ($(".slideshow :nth-child("+count+")").fadeOut().next().length == 0) ? 1 : count+1;
    $(".slideshow :nth-child("+count+")").fadeIn();
}, 2000);