react-responsive-carousel
react-responsive-carousel copied to clipboard
Got an error when using with Astrojs in .astro file
I'm trying to use it in a Astro project in .astro file, but get Type '{ children: any[]; "client:load": true; }' is not assignable to type 'IntrinsicAttributes & CarouselProps'. Type '{ children: any[]; "client:load": true; }' is missing the following properties from type 'CarouselProps': axis, centerSlidePercentage, interval, labels, and 27 more. error.
Gallery.astro
---
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
import { Carousel } from "react-responsive-carousel";
const photos = await Astro.glob("../images/photos/*.jpg");
---
<div class="w-1/3">
<Carousel client:load>
{
photos.map((photo) => (
<div>
<img src={photo.default.src} alt="" />
<p class="legend">Legend 1</p>
</div>
))
}
</Carousel>
</div>