react-responsive-carousel icon indicating copy to clipboard operation
react-responsive-carousel copied to clipboard

Got an error when using with Astrojs in .astro file

Open Sercurio opened this issue 1 year ago • 0 comments

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>

Sercurio avatar Apr 26 '24 12:04 Sercurio