the below code the transition or animation is not working but the image is just changing.
styles : {
imageStyle : {
opacity:1,
transition:"opacity 0.5s linear",
height: "304px",
width: "622px",
}
}
const imageBox =() =>{
const images = [ "one.jpeg", "two.jpeg", "three.jpeg", "four.jpeg" ];
const [currentIndex, setCurrentIndex] = useState(0);
return
<>
<img style={styles.imageStyle} src={images[currentIndex]} >
<button onclick={()=>setCurrentIndex(prevState => prevState + 1)}>next image</button>
<>
}