According to Bootstrap v4, your structure should look like
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
{testimonials.map((item => {
console.log("item, item) // <-- check the data and the nested objects here
return <div class="carousel-item active">
<Image fluid={photo.childImageSharp.fluid} alt={name} className="d-block mx-auto" />
<div class="carousel-caption d-none d-md-block">
<h5>...</h5>
<p>...</p>
</div>
</div>
}
</div>
Check that the data is being fetched properly with the console.log
above.
Keep also in mind, that the .active
class needs to be added to one of the slides. Otherwise, the carousel will not be visible.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…