Set TimeOut to React Function
问题 I have the following object list: mediaList[ {id:1, url:"www.example.com/image1", adType:"image/jpeg"}, {id:2, url:"www.example.com/image2", adType:"image/jpg"}, {id:3, url:"www.example.com/video1", adType: "video/mp4"} ] I need to create a slideshow that has a configurable duration (1s, 5, 10s). So far I can generate a list of the media from the mediaList renderSlideshow(ad){ let adType =ad.adType; if(type.includes("image")){ return( <div className="imagePreview"> <img src={ad.url} /> </div>